public class MqttByteBuffer extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
private cn.starboot.socket.utils.hutool.FastByteBuffer |
buffer |
| 构造器和说明 |
|---|
MqttByteBuffer() |
MqttByteBuffer(cn.starboot.socket.utils.hutool.FastByteBuffer buffer) |
MqttByteBuffer(int size) |
| 限定符和类型 | 方法和说明 |
|---|---|
void |
reset()
重置
|
int |
size()
buffer 大小
|
byte[] |
toArray()
转换成数组
|
ByteBuffer |
toBuffer()
转换成数组
|
void |
writeByte(byte b)
输出一个byte类型的数据
|
void |
writeBytes(byte[] bytes)
输出一个bytes类型的数据
|
void |
writeBytes(byte[] bytes,
int off,
int len)
输出一个bytes类型的数据
|
void |
writeInt(int v)
输出int数值,占用4个字节
|
void |
writeLong(long v)
输出long数值,占用8个字节
|
void |
writeShort(short v)
输出一个short类型的数据
|
void |
writeVarLengthInt(int num)
写可变长度整数
|
private final cn.starboot.socket.utils.hutool.FastByteBuffer buffer
public MqttByteBuffer()
public MqttByteBuffer(int size)
public MqttByteBuffer(cn.starboot.socket.utils.hutool.FastByteBuffer buffer)
public void writeByte(byte b)
b - 待输出数值public void writeBytes(byte[] bytes)
bytes - 待输出数值public void writeBytes(byte[] bytes,
int off,
int len)
bytes - 待输出数值off - offlen - lenpublic void writeShort(short v)
v - short数值public void writeInt(int v)
v - int数值public void writeLong(long v)
v - long数值public void writeVarLengthInt(int num)
num - numpublic byte[] toArray()
public ByteBuffer toBuffer()
public void reset()
public int size()
Copyright © 2023. All rights reserved.