public class Buffer extends java.lang.Object implements WritableToDataOutputStream
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
VERSION |
Constructor and Description |
---|
Buffer(byte[] data)
Create a Buffer from a byte array
|
Buffer(byte[] data,
int start,
int length) |
Buffer(java.io.DataInput dis)
Create a Buffer by reading a DataInputStream.
|
Modifier and Type | Method and Description |
---|---|
byte |
byteAt(int pos) |
void |
copyTo(byte[] array,
int position)
Copy the data to a byte array
|
boolean |
equals(java.lang.Object o) |
byte[] |
getData()
Retrieve a byte array containing the data in this buffer.
|
int |
getLength() |
int |
hashCode() |
java.lang.String |
toString() |
void |
writeToDataOutputStream(java.io.DataOutputStream stream) |
public static final java.lang.String VERSION
public Buffer(java.io.DataInput dis) throws java.io.IOException
dis
- to read bytes fromjava.lang.IllegalArgumentException
- If the length integer is negative or exceeds Serializer.MAX_ARRAY_LENGTH.java.io.IOException
- error reading from dispublic Buffer(byte[] data)
data
- public Buffer(byte[] data, int start, int length)
public byte[] getData()
public void copyTo(byte[] array, int position)
array
- position
- public byte byteAt(int pos)
public void writeToDataOutputStream(java.io.DataOutputStream stream) throws java.io.IOException
writeToDataOutputStream
in interface WritableToDataOutputStream
java.io.IOException
public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object o)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public int getLength()