public class Reader extends Object
| Modifier and Type | Method and Description |
|---|---|
void |
appendPacket(RawPacket rawPacket) |
byte |
getByteAt(int i) |
long |
getLengthEncodedBinary() |
byte[] |
getLengthEncodedBytes() |
byte[] |
getLengthEncodedBytesWithLength(long length) |
String |
getLengthEncodedString() |
byte |
getPacketSeq() |
int |
getRemainingSize() |
long |
getSilentLengthEncodedBinary() |
int |
read24bitword() |
byte |
readByte()
reads a byte from the buffer
|
int |
readInt()
read a int (4 bytes) from the buffer;
|
long |
readLong()
read a long (8 bytes) from the buffer;
|
byte[] |
readRawBytes(int numberOfBytes) |
short |
readShort()
read a short (2 bytes) from the buffer;
|
String |
readString(String charset)
Reads a string from the buffer, looks for a 0 to end the string
|
void |
skipByte() |
long |
skipBytes(int bytesToSkip) |
public Reader(RawPacket rawPacket)
public String readString(String charset) throws IOException
charset - the charset to use, for example ASCIIIOException - if it is not possible to create the string from the bufferpublic short readShort()
throws IOException
IOException - if there are not 2 bytes left in the bufferpublic int readInt()
throws IOException
IOException - if there are not 4 bytes left in the bufferpublic long readLong()
throws IOException
IOException - if there are not 8 bytes left in the bufferpublic byte readByte()
throws IOException
IOException - if bufferPointer exceeds the length of the bufferpublic byte[] readRawBytes(int numberOfBytes)
throws IOException
IOExceptionpublic void skipByte()
throws IOException
IOExceptionpublic long skipBytes(int bytesToSkip)
throws IOException
IOExceptionpublic int read24bitword()
throws IOException
IOExceptionpublic long getLengthEncodedBinary()
throws IOException
IOExceptionpublic String getLengthEncodedString() throws IOException
IOExceptionpublic byte[] getLengthEncodedBytes()
throws IOException
IOExceptionpublic byte[] getLengthEncodedBytesWithLength(long length)
public byte getByteAt(int i)
throws IOException
IOExceptionpublic byte getPacketSeq()
public int getRemainingSize()
public void appendPacket(RawPacket rawPacket)
public long getSilentLengthEncodedBinary()
throws IOException
IOExceptionCopyright © 2016. All rights reserved.