Interface ByteStoreAccess
- All Known Implementing Classes:
NioByteStoreAccess
public interface ByteStoreAccess
Interface for random access reading for data that has been written
into a byte store.
This resembles
DataInput, but omits some of the methods
there, and adds seek(long) and skip(int) methods.
A pointer is maintained, and is advanced appropriately by the various
read methods.- Since:
- 20 Aug 2010
- Author:
- Mark Taylor
-
Method Summary
Modifier and TypeMethodDescriptionbytereadByte()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.doubleReads a double from the current position.floatReads a float from the current position.intreadInt()Reads an int from the current position.longreadLong()Reads a long from the current position.shortReads 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 Details
-
readByte
Reads a byte from the current position.- Returns:
- read value
- Throws:
IOException
-
readShort
Reads a short from the current position.- Returns:
- read value
- Throws:
IOException
-
readChar
Reads a char from the current position.- Returns:
- read value
- Throws:
IOException
-
readInt
Reads an int from the current position.- Returns:
- read value
- Throws:
IOException
-
readLong
Reads a long from the current position.- Returns:
- read value
- Throws:
IOException
-
readFloat
Reads a float from the current position.- Returns:
- read value
- Throws:
IOException
-
readDouble
Reads a double from the current position.- Returns:
- read value
- Throws:
IOException
-
readBytes
Reads bytes into a buffer from the current position.- Parameters:
b- buffer to receive bytesoff- offset intobfor first bytelen- number of bytes to read- Throws:
IOException
-
seek
Sets the position to the given value.- Parameters:
pos- new position- Throws:
IOException
-
skip
Advances the position by a given number of bytes.- Parameters:
len- number of bytes- Throws:
IOException
-