public class DecodeByteBufferList extends Object
| 构造器和说明 |
|---|
DecodeByteBufferList() |
DecodeByteBufferList(int listCapacity) |
| 限定符和类型 | 方法和说明 |
|---|---|
DecodeByteBufferList |
add(ByteBuffer byteBuffer)
应用需要设置好limit和position
|
ByteBuffer |
checkGet(int len) |
byte |
get() |
DecodeByteBufferList |
get(byte[] dst) |
DecodeByteBufferList |
get(byte[] dst,
int offset,
int length) |
int |
getByteSize()
有多少个byte
|
char |
getChar() |
double |
getDouble() |
float |
getFloat() |
int |
getInt() |
List<ByteBuffer> |
getList() |
long |
getLong() |
short |
getShort() |
void |
notifyError()
应用告之,已经解码异常
|
void |
notifyFail()
应用告之,已经解码失败,相当于半包
此时需要恢复各状态到编码前
|
void |
notifyStart()
应用告之,准备开始解码
|
void |
notifySuccess()
应用告之,已经解码成功
此时需要清空前面参与编码的
|
String |
readString(int length,
Charset charset) |
DecodeByteBufferList |
skip(int len) |
ByteBuffer |
toByteBuffer() |
public DecodeByteBufferList(int listCapacity)
public DecodeByteBufferList()
public List<ByteBuffer> getList()
public int getByteSize()
public DecodeByteBufferList add(ByteBuffer byteBuffer)
byteBuffer - public ByteBuffer checkGet(int len)
public void notifySuccess()
public void notifyFail()
public void notifyError()
public void notifyStart()
public ByteBuffer toByteBuffer()
public byte get()
public char getChar()
public short getShort()
public int getInt()
public long getLong()
public float getFloat()
public double getDouble()
public DecodeByteBufferList get(byte[] dst, int offset, int length)
public DecodeByteBufferList get(byte[] dst)
public DecodeByteBufferList skip(int len)
Copyright © 2023. All rights reserved.