| Constructor and Description |
|---|
FastByteBuffer() |
FastByteBuffer(int size) |
| Modifier and Type | Method and Description |
|---|---|
FastByteBuffer |
append(byte element)
向快速缓冲加入一个字节
|
FastByteBuffer |
append(byte[] array)
向快速缓冲加入数据
|
FastByteBuffer |
append(byte[] array,
int off,
int len)
向快速缓冲加入数据
|
FastByteBuffer |
append(ByteBuffer buffer)
向快速缓冲加入数据
|
FastByteBuffer |
append(FastByteBuffer buff)
将另一个快速缓冲加入到自身
|
byte[] |
array(int index)
根据索引位返回缓冲集中的缓冲
|
byte |
get(int index)
根据索引位返回一个字节
|
int |
index()
当前缓冲位于缓冲区的索引位
|
boolean |
isEmpty() |
int |
offset() |
FastByteBuffer |
reset()
重置,用于复用
|
FastByteBuffer |
setBoolean(int index,
boolean value)
设置 boolean 值,true 为 1,false 为 0
|
FastByteBuffer |
setByte(int index,
int value)
设定指定位置的字节
|
FastByteBuffer |
setBytes(int index,
byte[] src)
设置指定 index 的 byte
|
FastByteBuffer |
setBytes(int index,
byte[] src,
int srcIndex,
int length)
设置字节
|
FastByteBuffer |
setDoubleBE(int index,
double value)
写出双精度浮点
|
FastByteBuffer |
setDoubleLE(int index,
double value)
写出双精度浮点
|
FastByteBuffer |
setFloatBE(int index,
float value)
写出单精度浮点
|
FastByteBuffer |
setFloatLE(int index,
float value)
写出单精度浮点
|
FastByteBuffer |
setIntBE(int index,
long value)
写出 4 个字节,大端模式
|
FastByteBuffer |
setIntLE(int index,
long value)
写出 4 个字节,小端模式
|
FastByteBuffer |
setLongBE(int index,
long value)
写出 8 个字节,大端模式
|
FastByteBuffer |
setLongLE(int index,
long value)
写出 8 个字节,小端模式
|
FastByteBuffer |
setMediumBE(int index,
int value)
写出 3 个字节,大端模式
|
FastByteBuffer |
setMediumLE(int index,
int value)
写出 3 个字节,小端模式
|
FastByteBuffer |
setShortBE(int index,
int value)
写出 short,大端模式
|
FastByteBuffer |
setShortLE(int index,
int value)
写出 short,小端模式
|
int |
size() |
byte[] |
toArray()
返回快速缓冲中的数据
|
byte[] |
toArray(int start,
int len)
返回快速缓冲中的数据
|
ByteBuffer |
toBuffer()
转换成数组
|
FastByteBuffer |
writeBoolean(boolean value)
写出一个 boolean 值,true 为 1,false 为 0
|
FastByteBuffer |
writeByte(int value)
写出一个byte类型的数据
|
FastByteBuffer |
writeBytes(byte[] bytes)
写出一个bytes类型的数据
|
FastByteBuffer |
writeBytes(byte[] bytes,
int off,
int len)
写出一个bytes类型的数据
|
FastByteBuffer |
writeDoubleBE(double value)
写出双精度浮点
|
FastByteBuffer |
writeDoubleLE(double value)
写出双精度浮点
|
FastByteBuffer |
writeFloatBE(float value)
写出单精度浮点
|
FastByteBuffer |
writeFloatLE(float value)
写出单精度浮点
|
FastByteBuffer |
writeIntBE(long value)
写出 4 个字节,大端模式
|
FastByteBuffer |
writeIntLE(long value)
写出 4 个字节,小端模式
|
FastByteBuffer |
writeLongBE(long value)
写出 8 个字节,大端模式
|
FastByteBuffer |
writeLongLE(long value)
写出 8 个字节,小端模式
|
FastByteBuffer |
writeMediumBE(int value)
写出 3 个字节,大端模式
|
FastByteBuffer |
writeMediumLE(int value)
写出 3 个字节,小端模式
|
FastByteBuffer |
writeShortBE(int value)
写出 short,大端模式
|
FastByteBuffer |
writeShortLE(int value)
写出 short,小端模式
|
void |
writeString(String text)
写出文本
|
void |
writeString(String text,
Charset charset)
写出文本
|
void |
writeString(String text,
String charset)
写出文本
|
FastByteBuffer |
writeVarLengthInt(int num)
写可变长度整数
|
public FastByteBuffer()
public FastByteBuffer(int size)
public FastByteBuffer append(byte[] array, int off, int len)
array - 数据off - 偏移量len - 字节数public FastByteBuffer append(ByteBuffer buffer)
buffer - 数据public FastByteBuffer append(byte[] array)
array - 数据public FastByteBuffer append(byte element)
element - 一个字节的数据public FastByteBuffer append(FastByteBuffer buff)
buff - 快速缓冲public FastByteBuffer writeBoolean(boolean value)
value - boolean valuepublic FastByteBuffer writeByte(int value)
value - 待写出数值public FastByteBuffer writeShortBE(int value)
value - 待写出数值public FastByteBuffer writeShortLE(int value)
value - 待写出数值public FastByteBuffer writeMediumBE(int value)
value - 待写出数值public FastByteBuffer writeMediumLE(int value)
value - 待写出数值public FastByteBuffer writeIntBE(long value)
value - 待写出数值public FastByteBuffer writeIntLE(long value)
value - 待写出数值public FastByteBuffer writeLongBE(long value)
value - 待写出数值public FastByteBuffer writeLongLE(long value)
value - 待写出数值public FastByteBuffer writeFloatBE(float value)
value - valuepublic FastByteBuffer writeFloatLE(float value)
value - valuepublic FastByteBuffer writeDoubleBE(double value)
value - valuepublic FastByteBuffer writeDoubleLE(double value)
value - valuepublic FastByteBuffer writeBytes(byte[] bytes)
bytes - 待写出数值public FastByteBuffer writeBytes(byte[] bytes, int off, int len)
bytes - 待写出数值off - offlen - lenpublic FastByteBuffer writeVarLengthInt(int num)
num - numpublic void writeString(String text)
text - 文本public void writeString(String text, String charset)
text - 文本charset - charsetpublic void writeString(String text, Charset charset)
text - 文本charset - charsetpublic FastByteBuffer setByte(int index, int value)
index - indexvalue - valuepublic FastByteBuffer setBoolean(int index, boolean value)
index - indexvalue - boolean valuepublic FastByteBuffer setShortBE(int index, int value)
index - indexvalue - 待写出数值public FastByteBuffer setShortLE(int index, int value)
index - indexvalue - 待写出数值public FastByteBuffer setMediumBE(int index, int value)
index - indexvalue - 待写出数值public FastByteBuffer setMediumLE(int index, int value)
index - indexvalue - 待写出数值public FastByteBuffer setIntBE(int index, long value)
index - indexvalue - 待写出数值public FastByteBuffer setIntLE(int index, long value)
index - indexvalue - 待写出数值public FastByteBuffer setLongBE(int index, long value)
index - indexvalue - 待写出数值public FastByteBuffer setLongLE(int index, long value)
index - indexvalue - 待写出数值public FastByteBuffer setFloatBE(int index, float value)
index - indexvalue - valuepublic FastByteBuffer setFloatLE(int index, float value)
index - indexvalue - valuepublic FastByteBuffer setDoubleBE(int index, double value)
index - indexvalue - valuepublic FastByteBuffer setDoubleLE(int index, double value)
index - indexvalue - valuepublic FastByteBuffer setBytes(int index, byte[] src)
index - indexsrc - srcpublic FastByteBuffer setBytes(int index, byte[] src, int srcIndex, int length)
index - indexsrc - srcsrcIndex - srcIndexlength - lengthpublic int size()
public boolean isEmpty()
public int index()
currentBufferIndexpublic int offset()
public byte[] array(int index)
index - 索引位public FastByteBuffer reset()
public byte[] toArray()
public byte[] toArray(int start,
int len)
start - 逻辑起始位置len - 逻辑字节长public ByteBuffer toBuffer()
public byte get(int index)
index - 索引位Copyright © 2025. All rights reserved.