public final class MqttCodecUtil extends Object
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
decodeByteArray(ByteBuffer buffer) |
static int |
decodeMsbLsb(ByteBuffer buffer)
整数数值是 16 位,使用大端序(big-endian,高位字节在低位字节前面)。
|
static String |
decodeUTF8(ByteBuffer buffer)
每一个字符串都有一个两字节的长度字段作为前缀,它给出这个字符串 UTF-8 编码的字节数,它们在图例
1.1 UTF-8 编码字符串的结构 中描述。
|
static int |
decodeVariableByteInteger(ByteBuffer buffer)
解码变长字节整数,规范1.5.5
|
static byte[] |
encodeUTF8(String str) |
static int |
getVariableLengthInt(int num) |
static void |
writeMsbLsb(MqttWriter writer,
int v) |
static void |
writeVariableLengthInt(MqttWriter buf,
int num) |
public static int decodeVariableByteInteger(ByteBuffer buffer)
public static void writeVariableLengthInt(MqttWriter buf, int num) throws IOException
IOExceptionpublic static String decodeUTF8(ByteBuffer buffer)
public static byte[] encodeUTF8(String str)
public static int decodeMsbLsb(ByteBuffer buffer)
public static void writeMsbLsb(MqttWriter writer, int v) throws IOException
IOExceptionpublic static byte[] decodeByteArray(ByteBuffer buffer)
public static int getVariableLengthInt(int num)
Copyright © 2025. All rights reserved.