|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
public interface BufferReader
| Method Summary | |
|---|---|
byte[] |
getBytes(int index,
int count)
|
double |
getDouble64(int index)
|
float |
getFloat32(int index)
|
short |
getInt16(int index)
Returns a signed 16-bit int calculated from two bytes of data at the specified index (MSB, LSB). |
int |
getInt32(int index)
Returns a signed 32-bit integer from four bytes of data at the specified index the buffer. |
long |
getInt64(int index)
Get a signed 64-bit integer from the buffer. |
byte |
getInt8(int index)
Returns a signed 8-bit int calculated from one byte of data at the specified index. |
long |
getLength()
Returns the length of the buffer. |
String |
getNullTerminatedString(int index,
int maxLengthBytes)
Creates a String from the _data buffer starting at the specified index, and ending where byte=='\0' or where length==maxLength. |
float |
getS15Fixed16(int index)
|
String |
getString(int index,
int bytesRequested)
|
String |
getString(int index,
int bytesRequested,
String charset)
|
int |
getUInt16(int index)
Returns an unsigned 16-bit int calculated from two bytes of data at the specified index. |
long |
getUInt32(int index)
Get a 32-bit unsigned integer from the buffer, returning it as a long. |
short |
getUInt8(int index)
Returns an unsigned 8-bit int calculated from one byte of data at the specified index. |
boolean |
isMotorolaByteOrder()
Gets the endianness of this reader. |
void |
setMotorolaByteOrder(boolean motorolaByteOrder)
Sets the endianness of this reader. |
| Method Detail |
|---|
long getLength()
void setMotorolaByteOrder(boolean motorolaByteOrder)
true for Motorola (or big) endiannessfalse for Intel (or little) endianness
motorolaByteOrder - true for motorola/big endian, false for intel/little endianboolean isMotorolaByteOrder()
true for Motorola (or big) endiannessfalse for Intel (or little) endianness
short getUInt8(int index)
throws BufferBoundsException
index - position within the data buffer to read byte
BufferBoundsException - the buffer does not contain enough bytes to service the request, or index is negative
byte getInt8(int index)
throws BufferBoundsException
index - position within the data buffer to read byte
BufferBoundsException - the buffer does not contain enough bytes to service the request, or index is negative
int getUInt16(int index)
throws BufferBoundsException
index - position within the data buffer to read first byte
BufferBoundsException - the buffer does not contain enough bytes to service the request, or index is negative
short getInt16(int index)
throws BufferBoundsException
index - position within the data buffer to read first byte
BufferBoundsException - the buffer does not contain enough bytes to service the request, or index is negative
long getUInt32(int index)
throws BufferBoundsException
index - position within the data buffer to read first byte
BufferBoundsException - the buffer does not contain enough bytes to service the request, or index is negative
int getInt32(int index)
throws BufferBoundsException
index - position within the data buffer to read first byte
BufferBoundsException - the buffer does not contain enough bytes to service the request, or index is negative
long getInt64(int index)
throws BufferBoundsException
index - position within the data buffer to read first byte
BufferBoundsException - the buffer does not contain enough bytes to service the request, or index is negative
float getS15Fixed16(int index)
throws BufferBoundsException
BufferBoundsException
float getFloat32(int index)
throws BufferBoundsException
BufferBoundsException
double getDouble64(int index)
throws BufferBoundsException
BufferBoundsException
byte[] getBytes(int index,
int count)
throws BufferBoundsException
BufferBoundsException
String getString(int index,
int bytesRequested)
throws BufferBoundsException
BufferBoundsException
String getString(int index,
int bytesRequested,
String charset)
throws BufferBoundsException
BufferBoundsException
String getNullTerminatedString(int index,
int maxLengthBytes)
throws BufferBoundsException
byte=='\0' or where length==maxLength.
index - The index within the buffer at which to start reading the string.maxLengthBytes - The maximum number of bytes to read. If a zero-byte is not reached within this limit,
reading will stop and the string will be truncated to this length.
BufferBoundsException - The buffer does not contain enough bytes to satisfy this request.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||