public class ByteUtil extends Object
| 构造器和说明 |
|---|
ByteUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static byte[] |
genCRC(byte[] data)
生成CRC校验码
|
static byte[] |
getBytes(byte[] data,
int start,
int end)
获取指定索引间的字节数组
|
static boolean |
isCRC(byte[] data,
byte[] crc)
CRC校验
|
static void |
main(String[] args) |
static byte[] |
readAllBytes(io.netty.buffer.ByteBuf buf)
读取bytebuf中所有字节,对头尾之外的做合并处理
|
static byte |
readByte(io.netty.buffer.ByteBuf buf)
读取一个字节,如果读到了拆分字节,则返回组装后的字节
|
static byte[] |
writeByte(byte bytes)
写一个字节,如果该字节需要拆分,则拆分后在写
|
public static byte readByte(io.netty.buffer.ByteBuf buf)
buf - public static byte[] readAllBytes(io.netty.buffer.ByteBuf buf)
buf - public static byte[] writeByte(byte bytes)
bytes - public static boolean isCRC(byte[] data,
byte[] crc)
data - public static byte[] genCRC(byte[] data)
data - public static byte[] getBytes(byte[] data,
int start,
int end)
data - start - end - public static void main(String[] args)
Copyright © 2018. All rights reserved.