public abstract class AbstractArrayBytesBuff extends Object implements BytesBuff
| 限定符和类型 | 字段和说明 |
|---|---|
static int |
DEFAULT_CAPACITY |
static int |
LEN_1 |
static int |
LEN_2 |
static int |
LEN_3 |
static int |
LEN_4 |
static int |
LEN_8 |
| 构造器和说明 |
|---|
AbstractArrayBytesBuff() |
AbstractArrayBytesBuff(byte[] initialArray) |
AbstractArrayBytesBuff(int capacity) |
| 限定符和类型 | 方法和说明 |
|---|---|
int |
capacity()
当前容量
|
protected BytesBuff |
ensureCapacity(int addBytes)
保证缓冲区大小
|
protected void |
ensureCapacityUnsafe(int addBytes)
保证缓冲区大小
|
protected byte[] |
getArray() |
boolean |
getBoolean(int index) |
byte |
getByte(int index) |
byte[] |
getBytes()
获取写入的字节数组(0~writeIndex)
|
BytesBuff |
getBytes(int index,
byte[] dst) |
BytesBuff |
getBytes(int index,
byte[] dst,
int dstIndex,
int length) |
BytesBuff |
getBytes(int index,
BytesBuff dst) |
BytesBuff |
getBytes(int index,
BytesBuff dst,
int length) |
BytesBuff |
getBytes(int index,
BytesBuff dst,
int dstIndex,
int length) |
BytesBuff |
getBytes(int index,
OutputStream out,
int length) |
char |
getChar(int index) |
double |
getDouble(int index) |
float |
getFloat(int index) |
int |
getInt(int index) |
int |
getIntLE(int index) |
long |
getLong(int index) |
long |
getLongLE(int index) |
int |
getMedium(int index) |
int |
getMediumLE(int index) |
byte[] |
getRawBytes()
获取全部字节数组
|
byte[] |
getReadableBytes()
获取可读取的字节数组(readIndex~writeIndex)
|
short |
getShort(int index) |
short |
getShortLE(int index) |
short |
getUnsignedByte(int index) |
long |
getUnsignedInt(int index) |
long |
getUnsignedIntLE(int index) |
int |
getUnsignedMedium(int index) |
int |
getUnsignedMediumLE(int index) |
int |
getUnsignedShort(int index) |
int |
getUnsignedShortLE(int index) |
int |
length()
有效数据长度 写入长度
|
BytesBuff |
setBoolean(int index,
boolean value) |
BytesBuff |
setByte(int index,
int value) |
BytesBuff |
setBytes(int index,
byte[] src) |
BytesBuff |
setBytes(int index,
byte[] src,
int srcIndex,
int length) |
BytesBuff |
setBytes(int index,
BytesBuff src) |
BytesBuff |
setBytes(int index,
BytesBuff src,
int length) |
BytesBuff |
setBytes(int index,
BytesBuff src,
int srcIndex,
int length) |
int |
setBytes(int index,
InputStream in,
int length) |
BytesBuff |
setChar(int index,
int value) |
BytesBuff |
setDouble(int index,
double value) |
BytesBuff |
setFloat(int index,
float value) |
BytesBuff |
setInt(int index,
int value) |
BytesBuff |
setIntLE(int index,
int value) |
BytesBuff |
setLong(int index,
long value) |
BytesBuff |
setLongLE(int index,
long value) |
BytesBuff |
setMedium(int index,
int value) |
BytesBuff |
setMediumLE(int index,
int value) |
BytesBuff |
setShort(int index,
int value) |
BytesBuff |
setShortLE(int index,
int value) |
BytesBuff |
setZero(int index,
int length) |
String |
toString() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitclear, copy, copy, markReaderIndex, markWriterIndex, readableBytes, readBoolean, readByte, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readBytes, readChar, readDouble, readerIndex, readerIndex, readFloat, readInt, readIntLE, readLong, readLongLE, readMedium, readMediumLE, readShort, readShortLE, readUnsignedByte, readUnsignedInt, readUnsignedIntLE, readUnsignedMedium, readUnsignedMediumLE, readUnsignedShort, readUnsignedShortLE, reset, resetReaderIndex, resetWriterIndex, setIndex, skipBytes, writableBytes, writeBoolean, writeByte, writeBytes, writeBytes, writeBytes, writeBytes, writeBytes, writeChar, writeDouble, writeFloat, writeInt, writeIntLE, writeLong, writeLongLE, writeMedium, writeMediumLE, writerIndex, writerIndex, writeShort, writeShortLEpublic static final int LEN_1
public static final int LEN_2
public static final int LEN_3
public static final int LEN_4
public static final int LEN_8
public static final int DEFAULT_CAPACITY
public AbstractArrayBytesBuff()
public AbstractArrayBytesBuff(int capacity)
public AbstractArrayBytesBuff(byte[] initialArray)
protected void ensureCapacityUnsafe(int addBytes)
addBytes - protected BytesBuff ensureCapacity(int addBytes)
addBytes - 增加的字节数组长度public byte[] getBytes()
BytesBuffpublic byte[] getReadableBytes()
BytesBuffgetReadableBytes 在接口中 BytesBuffpublic byte[] getRawBytes()
BytesBuffgetRawBytes 在接口中 BytesBuffprotected byte[] getArray()
public boolean getBoolean(int index)
getBoolean 在接口中 BytesBuffpublic short getUnsignedByte(int index)
getUnsignedByte 在接口中 BytesBuffpublic short getShortLE(int index)
getShortLE 在接口中 BytesBuffpublic int getUnsignedShort(int index)
getUnsignedShort 在接口中 BytesBuffpublic int getUnsignedShortLE(int index)
getUnsignedShortLE 在接口中 BytesBuffpublic int getMediumLE(int index)
getMediumLE 在接口中 BytesBuffpublic int getUnsignedMedium(int index)
getUnsignedMedium 在接口中 BytesBuffpublic int getUnsignedMediumLE(int index)
getUnsignedMediumLE 在接口中 BytesBuffpublic long getUnsignedInt(int index)
getUnsignedInt 在接口中 BytesBuffpublic long getUnsignedIntLE(int index)
getUnsignedIntLE 在接口中 BytesBuffpublic BytesBuff getBytes(int index, byte[] dst, int dstIndex, int length)
public BytesBuff getBytes(int index, OutputStream out, int length) throws IOException
getBytes 在接口中 BytesBuffIOExceptionpublic BytesBuff setBoolean(int index, boolean value)
setBoolean 在接口中 BytesBuffpublic BytesBuff setShortLE(int index, int value)
setShortLE 在接口中 BytesBuffpublic BytesBuff setMediumLE(int index, int value)
setMediumLE 在接口中 BytesBuffpublic BytesBuff setBytes(int index, byte[] src, int srcIndex, int length)
public int setBytes(int index,
InputStream in,
int length)
throws IOException
setBytes 在接口中 BytesBuffIOExceptionCopyright © 2020. All rights reserved.