public class FixLengthStringProtocol extends Object implements Protocol<ByteBuffer,String>
| 构造器和说明 |
|---|
FixLengthStringProtocol() |
FixLengthStringProtocol(Byte endFlag) |
FixLengthStringProtocol(LenType lenType,
Byte endFlag)
cn.ibaijia.soe.core.protocol.lenType
|
| 限定符和类型 | 方法和说明 |
|---|---|
String |
decode(ByteBuffer readBuffer,
Session session) |
ByteBuffer |
encode(String object,
Session session) |
Charset |
getCharset() |
void |
setCharset(Charset charset) |
public FixLengthStringProtocol()
public FixLengthStringProtocol(Byte endFlag)
public String decode(ByteBuffer readBuffer, Session session)
decode 在接口中 Protocol<ByteBuffer,String>readBuffer - 需要解码的数据 如果是buffer 不需要flip,框架已经flip了,毕竟使用者又可以少写一行代码public ByteBuffer encode(String object, Session session)
encode 在接口中 Protocol<ByteBuffer,String>object - 需要编码的数据public Charset getCharset()
public void setCharset(Charset charset)
Copyright © 2019. All rights reserved.