public final class ByteArrayBuffer extends Buffer
Buffer
using a backing byte arrayModifier and Type | Field and Description |
---|---|
static int |
DEFAULT_SIZE |
static int |
MAX_LEN |
Constructor and Description |
---|
ByteArrayBuffer() |
ByteArrayBuffer(byte[] data) |
ByteArrayBuffer(byte[] data,
boolean read) |
ByteArrayBuffer(byte[] data,
int off,
int len) |
ByteArrayBuffer(byte[] data,
int off,
int len,
boolean read) |
ByteArrayBuffer(int size) |
ByteArrayBuffer(int size,
boolean roundOff) |
Modifier and Type | Method and Description |
---|---|
byte[] |
array() |
int |
available() |
int |
capacity() |
void |
clear() |
void |
compact() |
void |
ensureCapacity(int capacity,
Int2IntFunction growthFactor) |
byte |
getByte() |
void |
getRawBytes(byte[] buf,
int off,
int len) |
String |
getString(Charset charset) |
int |
putBuffer(Readable buffer,
boolean expand) |
void |
putByte(byte b) |
void |
putRawBytes(byte[] d,
int off,
int len) |
int |
rpos() |
void |
rpos(int rpos) |
protected int |
size() |
int |
wpos() |
void |
wpos(int wpos) |
ensureAvailable, ensureCapacity, extractEC, getAvailableStrings, getAvailableStrings, getBoolean, getBytes, getCompactData, getInt, getKeyPair, getLong, getMPInt, getMPIntAsBytes, getPublicKey, getPublicKey, getRawBytes, getRawPublicKey, getRawPublicKey, getShort, getString, getStringList, getStringList, getStringList, getStringList, getUByte, getUInt, printHex, putBoolean, putBuffer, putBytes, putBytes, putInt, putKeyPair, putLong, putMPInt, putMPInt, putPublicKey, putRawBytes, putRawPublicKey, putShort, putString, putString, putStringList, putStringList, toString
public static final int DEFAULT_SIZE
public static final int MAX_LEN
public ByteArrayBuffer()
public ByteArrayBuffer(int size)
public ByteArrayBuffer(int size, boolean roundOff)
public ByteArrayBuffer(byte[] data)
public ByteArrayBuffer(byte[] data, boolean read)
public ByteArrayBuffer(byte[] data, int off, int len)
public ByteArrayBuffer(byte[] data, int off, int len, boolean read)
public int available()
public int putBuffer(Readable buffer, boolean expand)
public void putRawBytes(byte[] d, int off, int len)
putRawBytes
in class Buffer
public void getRawBytes(byte[] buf, int off, int len)
public void ensureCapacity(int capacity, Int2IntFunction growthFactor)
ensureCapacity
in class Buffer
capacity
- The requires capacitygrowthFactor
- An Int2IntFunction
that is invoked
if the current capacity is insufficient. The argument is the minimum
required new data length, the function result should be the
effective new data length to be allocated - if less than minimum
then an exception is thrownCopyright © 2008–2016 The Apache Software Foundation. All rights reserved.