public class ByteBufferUtil extends Object
| 限定符和类型 | 字段和说明 |
|---|---|
static byte[] |
EMPTY_BYTES
空 byte 数组
|
| 构造器和说明 |
|---|
ByteBufferUtil() |
| 限定符和类型 | 方法和说明 |
|---|---|
static ByteBuffer |
clone(ByteBuffer original)
ByteBuffer clone
|
static String |
hexDump(ByteBuffer byteBuffer)
以16进制 打印 ByteBuffer
|
static byte |
readByte(ByteBuffer buffer)
read byte
|
static String |
readString(ByteBuffer buffer,
int count)
read unsigned byte
|
static String |
readString(ByteBuffer buffer,
int count,
Charset charset)
read unsigned byte
|
static short |
readUnsignedByte(ByteBuffer buffer)
read unsigned byte
|
static int |
readUnsignedShort(ByteBuffer buffer)
read unsigned byte
|
static ByteBuffer |
skipBytes(ByteBuffer buffer,
int skip)
skip bytes
|
static String |
toHexString(byte[] bytes)
以16进制 打印字节数组
|
static String |
toString(ByteBuffer buffer)
转成 string
|
static String |
toString(ByteBuffer buffer,
Charset charset)
转成 string
|
public static byte readByte(ByteBuffer buffer)
buffer - ByteBufferpublic static short readUnsignedByte(ByteBuffer buffer)
buffer - ByteBufferpublic static String readString(ByteBuffer buffer, int count)
buffer - ByteBufferpublic static String readString(ByteBuffer buffer, int count, Charset charset)
buffer - ByteBufferpublic static int readUnsignedShort(ByteBuffer buffer)
buffer - ByteBufferpublic static ByteBuffer skipBytes(ByteBuffer buffer, int skip)
buffer - ByteBufferskip - skip bytespublic static String toString(ByteBuffer buffer)
buffer - ByteBufferpublic static String toString(ByteBuffer buffer, Charset charset)
buffer - ByteBuffercharset - Charsetpublic static ByteBuffer clone(ByteBuffer original)
original - ByteBufferpublic static String hexDump(ByteBuffer byteBuffer)
byteBuffer - ByteBufferpublic static String toHexString(byte[] bytes)
bytes - byte[]Copyright © 2023. All rights reserved.