public class Buffers extends Object
| 构造器和说明 |
|---|
Buffers() |
| 限定符和类型 | 方法和说明 |
|---|---|
static void |
position(ByteBuffer buffer,
int position)
set position
|
static void |
position(ByteBuffer buffer,
long position)
set position
|
static String |
readAsciiString(ByteBuffer buffer,
int strLen)
Read ascii string ,by len
|
static byte[] |
readBytes(ByteBuffer buffer)
get all bytes remains
|
static byte[] |
readBytes(ByteBuffer buffer,
int size)
get bytes
|
static String |
readString(ByteBuffer buffer,
int strLen)
read utf16 strings, use strLen, not ending 0 char.
|
static short |
readUByte(ByteBuffer buffer)
get one unsigned byte as short type
|
static long |
readUInt(ByteBuffer buffer)
get one unsigned int as long type
|
static int |
readUShort(ByteBuffer buffer)
get one unsigned short as int type
|
static String |
readZeroTerminatedString(ByteBuffer buffer,
int strLen)
read utf16 strings, ending with 0 char.
|
static void |
skip(ByteBuffer buffer,
int count)
skip count bytes
|
static ByteBuffer |
sliceAndSkip(ByteBuffer buffer,
int size)
Return one new ByteBuffer from current position, with size, the byte order of new buffer will be set to little endian;
And advance the original buffer with size.
|
public static short readUByte(ByteBuffer buffer)
public static int readUShort(ByteBuffer buffer)
public static long readUInt(ByteBuffer buffer)
public static byte[] readBytes(ByteBuffer buffer, int size)
public static byte[] readBytes(ByteBuffer buffer)
public static String readAsciiString(ByteBuffer buffer, int strLen)
public static String readString(ByteBuffer buffer, int strLen)
public static String readZeroTerminatedString(ByteBuffer buffer, int strLen)
public static void skip(ByteBuffer buffer, int count)
public static void position(ByteBuffer buffer, int position)
public static void position(ByteBuffer buffer, long position)
public static ByteBuffer sliceAndSkip(ByteBuffer buffer, int size)
Copyright © 2019. All rights reserved.