Package uk.ac.starlink.table.storage
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 TypeMethodDescriptionbyte
readByte()
Reads a byte from the current position.void
readBytes
(byte[] b, int off, int len) Reads bytes into a buffer from the current position.char
readChar()
Reads a char from the current position.double
Reads a double from the current position.float
Reads a float from the current position.int
readInt()
Reads an int from the current position.long
readLong()
Reads a long from the current position.short
Reads a short from the current position.void
seek
(long pos) Sets the position to the given value.void
skip
(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 intob
for 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
-