public class BinaryReader extends Object implements Closeable
Objects of this class should not be created directly as they are part of the internal logic.
| Modifier and Type | Field and Description |
|---|---|
List<Integer> |
list
List of integers used to create arrays of integers where the length of
the list is not known before reading starts.
|
| Constructor and Description |
|---|
BinaryReader(byte[] data)
Creates a new BinaryReader object from byte array.
|
BinaryReader(ByteBuffer byteBuffer)
Creates a new BinaryReader from a byte buffer.
|
BinaryReader(FileInputStream fileInputStream)
Creates a new BinaryReader object from file input stream.
|
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Set the byte buffer to null to prevent any further access to the under
lying data.
|
int |
getPos() |
boolean |
readBoolean() |
byte |
readByte() |
byte[] |
readBytes(int length) |
short |
readInt16() |
int |
readInt32() |
int |
readUInt16() |
void |
setPos(int pos)
Sets position.
|
public BinaryReader(byte[] data)
data - byte array to use as the source.public BinaryReader(FileInputStream fileInputStream) throws IOException
fileInputStream - an open stream to the data file.IOException - if there was a problem accessing data file.public BinaryReader(ByteBuffer byteBuffer)
byteBuffer - mapped to the data file.public void setPos(int pos)
pos - position to set.public int getPos()
public byte readByte()
public short readInt16()
public int readUInt16()
public int readInt32()
public boolean readBoolean()
public byte[] readBytes(int length)
public void close()
close in interface Closeableclose in interface AutoCloseableCopyright © 2015 51Degrees. All rights reserved.