public class ReadBuffer
extends java.lang.Object
RandomAccessFile into a buffer and decodes the data.| Modifier and Type | Method and Description |
|---|---|
int |
getPositionAndSkip() |
byte |
readByte()
Returns one signed byte from the read buffer.
|
float |
readFloat()
Converts four bytes from the read buffer to a float.
|
boolean |
readFromFile(int length)
Reads the given amount of bytes from the file into the read buffer and
resets the internal buffer position.
|
int |
readInt()
Converts four bytes from the read buffer to a signed int.
|
long |
readLong()
Converts eight bytes from the read buffer to a signed long.
|
int |
readShort()
Converts two bytes from the read buffer to a signed int.
|
int |
readSignedInt()
Converts a variable amount of bytes from the read buffer to a signed int.
|
void |
readSignedInt(int[] values,
int length)
Converts a variable amount of bytes from the read buffer to a signed int
array.
|
int |
readUnsignedInt()
Converts a variable amount of bytes from the read buffer to an unsigned
int.
|
java.lang.String |
readUTF8EncodedString()
Decodes a variable amount of bytes from the read buffer to a string.
|
java.lang.String |
readUTF8EncodedString(int stringLength)
Decodes the given amount of bytes from the read buffer to a string.
|
java.lang.String |
readUTF8EncodedStringAt(int position)
Decodes a variable amount of bytes from the read buffer to a string.
|
public byte readByte()
public float readFloat()
public boolean readFromFile(int length)
throws java.io.IOException
length - the amount of bytes to read from the file.java.io.IOException - if an error occurs while reading the file.public int readInt()
public long readLong()
public int readShort()
public int readSignedInt()
public void readSignedInt(int[] values,
int length)
values - result valueslength - number of values to readpublic int readUnsignedInt()
public java.lang.String readUTF8EncodedString()
public int getPositionAndSkip()
public java.lang.String readUTF8EncodedString(int stringLength)
stringLength - the length of the string in bytes.public java.lang.String readUTF8EncodedStringAt(int position)
position - buffer offset position of string