public class ByteArrayBuffer extends Buffer
Buffer using a backing byte array| Modifier 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(boolean wipeData) |
void |
compact() |
protected void |
copyRawBytes(int offset,
byte[] buf,
int pos,
int len) |
void |
ensureCapacity(int capacity,
IntUnaryOperator growthFactor) |
byte |
getByte() |
static ByteArrayBuffer |
getCompactClone(byte[] data)
Creates a compact buffer (i.e., one that starts at offset zero) containing a copy
of the original data
|
static ByteArrayBuffer |
getCompactClone(byte[] data,
int offset,
int len)
Creates a compact buffer (i.e., one that starts at offset zero) containing a copy
of the original data
|
void |
getRawBytes(byte[] buf,
int off,
int len) |
String |
getString(Charset charset) |
void |
putBuffer(ByteBuffer buffer) |
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) |
clear, dumpHex, dumpHex, 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, isValidMessageStructure, isValidMessageStructure, putAndWipeBytes, putAndWipeBytes, putAndWipeChars, putAndWipeChars, putAndWipeChars, putAndWipeChars, putBoolean, putBuffer, putBytes, putBytes, putChars, putChars, putChars, putChars, putInt, putKeyPair, putLong, putMPInt, putMPInt, putPublicKey, putRawBytes, putRawPublicKey, putShort, putString, putString, putStringList, putStringList, toHex, toStringpublic 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 putBuffer(ByteBuffer buffer)
public void putRawBytes(byte[] d,
int off,
int len)
putRawBytes in class Bufferpublic void getRawBytes(byte[] buf,
int off,
int len)
protected void copyRawBytes(int offset,
byte[] buf,
int pos,
int len)
copyRawBytes in class Bufferpublic void ensureCapacity(int capacity,
IntUnaryOperator growthFactor)
ensureCapacity in class Buffercapacity - The requires capacitygrowthFactor - An IntUnaryOperator 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 thrownpublic static ByteArrayBuffer getCompactClone(byte[] data)
data - The original data bufferByteArrayBuffer containing a copy of the original data
starting at zero read positiongetCompactClone(byte[], int, int)public static ByteArrayBuffer getCompactClone(byte[] data, int offset, int len)
data - The original data bufferoffset - The offset of the valid data in the bufferlen - The size (in bytes) of of the valid data in the bufferByteArrayBuffer containing a copy of the original data
starting at zero read positionCopyright © 2008–2017 The Apache Software Foundation. All rights reserved.