public class InputBuffer
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected boolean |
_valid |
| Constructor and Description |
|---|
InputBuffer()
Create a new buffer.
|
InputBuffer(byte[] b)
Create our own copy of the byte array.
|
InputBuffer(InputBuffer buff)
Create a new buffer and copy the provided one.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
buffer()
Return the internal byte buffer.
|
void |
copy(InputBuffer buff)
Copy the existing buffer.
|
int |
length()
Return the length of the byte buffer.
|
void |
print(java.io.PrintWriter strm)
Print information about this instance.
|
boolean |
reread()
Reset the read pointer for this buffer.
|
void |
setBuffer(byte[] b)
Set the buffer to be used by this instance.
|
boolean |
unpackBoolean()
Unpack a boolean from the stream.
|
byte |
unpackByte()
Unpack a byte from the stream.
|
byte[] |
unpackBytes()
Unpack the next byte array from the stream.
|
char |
unpackChar()
Unpack a character from the stream.
|
double |
unpackDouble()
Unpack a double from the stream.
|
float |
unpackFloat()
Unpack a float from the stream.
|
void |
unpackFrom(InputBuffer buff)
Unpack a buffer from the provided buffer, and initialise this instance
with it.
|
int |
unpackInt()
Unpack an integer from the stream.
|
long |
unpackLong()
Unpack a long from the stream.
|
short |
unpackShort()
Unpack a short from the stream.
|
java.lang.String |
unpackString()
Unpack a String from the stream.
|
boolean |
valid()
Is the buffer valid?
|
public InputBuffer()
public InputBuffer(byte[] b)
public InputBuffer(InputBuffer buff)
public final boolean valid()
public void copy(InputBuffer buff)
public final int length()
public final byte[] buffer()
public final void setBuffer(byte[] b)
public final byte unpackByte()
throws java.io.IOException
java.io.IOExceptionpublic final byte[] unpackBytes()
throws java.io.IOException
java.io.IOExceptionpublic final boolean unpackBoolean()
throws java.io.IOException
java.io.IOExceptionpublic final char unpackChar()
throws java.io.IOException
java.io.IOExceptionpublic final short unpackShort()
throws java.io.IOException
java.io.IOExceptionpublic final int unpackInt()
throws java.io.IOException
java.io.IOExceptionpublic final long unpackLong()
throws java.io.IOException
java.io.IOExceptionpublic final float unpackFloat()
throws java.io.IOException
java.io.IOExceptionpublic final double unpackDouble()
throws java.io.IOException
java.io.IOExceptionpublic final java.lang.String unpackString()
throws java.io.IOException
java.io.IOExceptionpublic void unpackFrom(InputBuffer buff) throws java.io.IOException
java.io.IOExceptionpublic final boolean reread()
public void print(java.io.PrintWriter strm)