Package uk.ac.starlink.table.storage
Interface ByteStoreAccess
-
- All Known Implementing Classes:
NioByteStoreAccess
public interface ByteStoreAccessInterface for random access reading for data that has been written into a byte store. This resemblesDataInput, but omits some of the methods there, and addsseek(long)andskip(int)methods. A pointer is maintained, and is advanced appropriately by the various read methods.- Since:
- 20 Aug 2010
- Author:
- Mark Taylor
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description bytereadByte()Reads a byte from the current position.voidreadBytes(byte[] b, int off, int len)Reads bytes into a buffer from the current position.charreadChar()Reads a char from the current position.doublereadDouble()Reads a double from the current position.floatreadFloat()Reads a float from the current position.intreadInt()Reads an int from the current position.longreadLong()Reads a long from the current position.shortreadShort()Reads a short from the current position.voidseek(long pos)Sets the position to the given value.voidskip(int len)Advances the position by a given number of bytes.
-
-
-
Method Detail
-
readByte
byte readByte() throws java.io.IOExceptionReads a byte from the current position.- Returns:
- read value
- Throws:
java.io.IOException
-
readShort
short readShort() throws java.io.IOExceptionReads a short from the current position.- Returns:
- read value
- Throws:
java.io.IOException
-
readChar
char readChar() throws java.io.IOExceptionReads a char from the current position.- Returns:
- read value
- Throws:
java.io.IOException
-
readInt
int readInt() throws java.io.IOExceptionReads an int from the current position.- Returns:
- read value
- Throws:
java.io.IOException
-
readLong
long readLong() throws java.io.IOExceptionReads a long from the current position.- Returns:
- read value
- Throws:
java.io.IOException
-
readFloat
float readFloat() throws java.io.IOExceptionReads a float from the current position.- Returns:
- read value
- Throws:
java.io.IOException
-
readDouble
double readDouble() throws java.io.IOExceptionReads a double from the current position.- Returns:
- read value
- Throws:
java.io.IOException
-
readBytes
void readBytes(byte[] b, int off, int len) throws java.io.IOExceptionReads bytes into a buffer from the current position.- Parameters:
b- buffer to receive bytesoff- offset intobfor first bytelen- number of bytes to read- Throws:
java.io.IOException
-
seek
void seek(long pos) throws java.io.IOException
Sets the position to the given value.- Parameters:
pos- new position- Throws:
java.io.IOException
-
skip
void skip(int len) throws java.io.IOException
Advances the position by a given number of bytes.- Parameters:
len- number of bytes- Throws:
java.io.IOException
-
-