public class ImPacket
extends org.tio.core.intf.Packet
Modifier and Type | Field and Description |
---|---|
protected byte[] |
body |
protected Status |
status |
Constructor and Description |
---|
ImPacket() |
ImPacket(byte[] body) |
ImPacket(Command command) |
ImPacket(Command command,
byte[] body) |
Modifier and Type | Method and Description |
---|---|
int |
calcHeaderLength(boolean is4byteLength)
计算消息头占用了多少字节数
|
static boolean |
decode4ByteLength(byte version) |
static boolean |
decodeCompress(byte version) |
static boolean |
decodeHasSynSeq(byte maskByte) |
static byte |
decodeVersion(byte version) |
static byte |
encode4ByteLength(byte bs,
boolean is4ByteLength) |
static byte |
encodeCompress(byte bs,
boolean isCompress) |
static byte |
encodeEncrypt(byte bs,
boolean isEncrypt) |
static byte |
encodeHasSynSeq(byte bs,
boolean hasSynSeq) |
byte[] |
getBody() |
Command |
getCommand() |
Status |
getStatus() |
boolean |
isFromCluster() |
String |
logstr() |
void |
setBody(byte[] body) |
void |
setCommand(Command type) |
void |
setFromCluster(boolean isFromCluster) |
void |
setStatus(Status status) |
clone, getByteCount, getId, getMeta, getPacketListener, getPreEncodedByteBuffer, getRespId, getSynSeq, isBlockSend, isSslEncrypted, setBlockSend, setByteCount, setId, setMeta, setPacketListener, setPreEncodedByteBuffer, setRespId, setSslEncrypted, setSynSeq
protected Status status
protected byte[] body
public ImPacket()
public ImPacket(byte[] body)
public ImPacket(Command command, byte[] body)
public ImPacket(Command command)
public static byte encodeEncrypt(byte bs, boolean isEncrypt)
public static boolean decodeCompress(byte version)
public static byte encodeCompress(byte bs, boolean isCompress)
public static boolean decodeHasSynSeq(byte maskByte)
public static byte encodeHasSynSeq(byte bs, boolean hasSynSeq)
public static boolean decode4ByteLength(byte version)
public static byte encode4ByteLength(byte bs, boolean is4ByteLength)
public static byte decodeVersion(byte version)
public int calcHeaderLength(boolean is4byteLength)
public Command getCommand()
public void setCommand(Command type)
public byte[] getBody()
public void setBody(byte[] body)
body
- the body to setpublic String logstr()
logstr
in class org.tio.core.intf.Packet
Packet.logstr()
public Status getStatus()
public void setStatus(Status status)
public boolean isFromCluster()
isFromCluster
in class org.tio.core.intf.Packet
public void setFromCluster(boolean isFromCluster)
setFromCluster
in class org.tio.core.intf.Packet
Copyright © 2018. All rights reserved.