public final class ByteBuffer
extends java.lang.Object
The byte buffer is unsynchronized.
Constructor and Description |
---|
ByteBuffer() |
ByteBuffer(int minimumCapacity) |
Modifier and Type | Method and Description |
---|---|
void |
add(byte[] buffer,
int offset,
int length) |
void |
add(char[] s,
int offset,
int len) |
void |
add(CharBuffer cb) |
void |
add(int data) |
void |
add(int i,
byte[] buffer,
int offset,
int length)
Inserts a byte array
|
void |
add(int i,
int data)
Inserts a byte array
|
void |
add(java.lang.String s) |
void |
addByte(int v) |
void |
addDouble(double v) |
void |
addFloat(float v) |
void |
addInt(int s) |
void |
addInt(int i,
int s) |
void |
addLong(long v) |
void |
addShort(int s) |
void |
addShort(int i,
int s) |
void |
addString(java.lang.String s) |
void |
addString(java.lang.String s,
java.lang.String encoding)
Adds a string with a specified encoding.
|
void |
append(byte[] buffer,
int offset,
int length)
Inserts a byte array
|
void |
append(int b)
Add a byte to the buffer.
|
void |
append(java.lang.String string)
Appends an int (little endian) in the buffer
|
void |
appendInt(int s)
Appends an int (little endian) in the buffer
|
void |
appendShort(int s)
Appends a short (little endian) in the buffer
|
byte |
byteAt(int i)
Returns the byte at the specified offset.
|
int |
capacity()
Returns the actual capacity of the buffer, i.e.
|
void |
clear() |
java.lang.Object |
clone()
Clones the buffer
|
java.io.InputStream |
createInputStream() |
java.io.OutputStream |
createOutputStream() |
ReadStream |
createReadStream() |
void |
ensureCapacity(int minimumCapacity)
Ensure the buffer can hold at least 'minimumCapacity' bytes.
|
boolean |
equals(java.lang.Object b) |
byte |
get(int i) |
byte[] |
getBuffer()
Returns the byte array for the buffer.
|
byte[] |
getByteArray()
Returns the bytes
|
int |
getInt(int i) |
int |
getLength()
Returns the buffer length
|
short |
getShort(int i) |
int |
hashCode() |
int |
indexOf(byte[] buffer,
int offset,
int length) |
void |
insert(int i,
byte[] buffer,
int offset,
int length) |
int |
length()
Returns the buffer length
|
void |
print(int i) |
void |
remove(int begin,
int length) |
void |
replace(int i,
byte[] buffer,
int offset,
int length)
Inserts a byte array
|
void |
replaceInt(int i,
int v)
Inserts a int (little endian) into the buffer
|
void |
replaceShort(int i,
int s)
Inserts a short into the buffer
|
void |
set(int i,
byte[] buffer,
int offset,
int length) |
void |
set(int i,
int data) |
void |
setByteAt(int i,
int b)
Returns the byte at the specified offset.
|
void |
setInt(int i,
int v) |
void |
setLength(int len)
Set the buffer.
|
void |
setShort(int i,
int s) |
int |
size() |
java.lang.String |
toString()
String representation of the buffer.
|
java.lang.String |
toString(java.lang.String encoding) |
public int capacity()
public int hashCode()
hashCode
in class java.lang.Object
public void ensureCapacity(int minimumCapacity)
public int length()
public int size()
public int getLength()
public void setLength(int len)
public void clear()
public byte[] getBuffer()
public void append(int b)
public void add(int i, byte[] buffer, int offset, int length)
public void add(byte[] buffer, int offset, int length)
public void add(int i, int data)
public void add(int data)
public void set(int i, byte[] buffer, int offset, int length)
public void set(int i, int data)
public void insert(int i, byte[] buffer, int offset, int length)
public void replace(int i, byte[] buffer, int offset, int length)
public void append(byte[] buffer, int offset, int length)
public void addByte(int v)
public void replaceShort(int i, int s)
public void appendShort(int s)
public void addShort(int s)
public void addShort(int i, int s)
public void setShort(int i, int s)
public void replaceInt(int i, int v)
public void appendInt(int s)
public void addInt(int s)
public void addInt(int i, int s)
public void setInt(int i, int v)
public void addLong(long v)
public void addFloat(float v)
public void addDouble(double v)
public void addString(java.lang.String s)
public void addString(java.lang.String s, java.lang.String encoding)
public void add(java.lang.String s)
public void add(char[] s, int offset, int len)
public void add(CharBuffer cb)
public void remove(int begin, int length)
public void append(java.lang.String string)
public byte byteAt(int i)
public void setByteAt(int i, int b)
public byte get(int i)
public short getShort(int i)
public int getInt(int i)
public void print(int i)
public int indexOf(byte[] buffer, int offset, int length)
public java.lang.Object clone()
clone
in class java.lang.Object
public boolean equals(java.lang.Object b)
equals
in class java.lang.Object
public java.io.InputStream createInputStream()
public java.io.OutputStream createOutputStream()
public ReadStream createReadStream()
public byte[] getByteArray()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toString(java.lang.String encoding)