public class InputBuffer extends 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(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.
|
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 IOException
IOExceptionpublic final byte[] unpackBytes()
throws IOException
IOExceptionpublic final boolean unpackBoolean()
throws IOException
IOExceptionpublic final char unpackChar()
throws IOException
IOExceptionpublic final short unpackShort()
throws IOException
IOExceptionpublic final int unpackInt()
throws IOException
IOExceptionpublic final long unpackLong()
throws IOException
IOExceptionpublic final float unpackFloat()
throws IOException
IOExceptionpublic final double unpackDouble()
throws IOException
IOExceptionpublic final String unpackString() throws IOException
IOExceptionpublic void unpackFrom(InputBuffer buff) throws IOException
IOExceptionpublic final boolean reread()
public void print(PrintWriter strm)
Copyright © 2012. All Rights Reserved.