|
JML | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.jqql.packets.PacketHelper
public final class PacketHelper
Constructor Summary | |
---|---|
PacketHelper(int supportedFamily)
|
Method Summary | |
---|---|
boolean |
isDuplicated(InPacket packet)
checkout packet is whether duplicated received 检查包是否重复收到 |
boolean |
isReplied(OutPacket packet,
boolean add)
this method checkout packet whether is received, remarkable is that checkout is for hash value of this packet, not for packet object, account of hash value is completing in hashCode in packet. |
InPacket |
parseIn(int supportedFamily,
ByteBuffer buf,
QQUser user,
boolean debug)
parse content of ByteBuffer to a InPacket subclass, from current position of buf to limit either success or not, should set position of buf after length 把ByteBuffer中的内容解析成一个InPacket子类,从buf的当前位置开始解析,直到limit为止 不论解析成功或者失败,要把buf的position置于length后 |
OutPacket |
parseOut(int supportedFamily,
ByteBuffer buf,
QQUser user)
parse content of ByteBuffer to a InPacket subclass, from current position of buf to limit either success or not, should set position of buf after length 把ByteBuffer中的内容解析成一个InPacket子类,从buf的当前位置开始解析,直到limit为止 不论解析成功或者失败,要把buf的position置于length后 |
void |
putSent(OutPacket out)
save sent packet 缓存输出包 |
boolean |
relocate(int relocateFamily,
ByteBuffer buf)
set position after initial position of next packet. |
OutPacket |
retrieveSent(InPacket in)
get request packet from reply packet 通过回复包获得请求包 |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PacketHelper(int supportedFamily)
Method Detail |
---|
public OutPacket retrieveSent(InPacket in)
in
- reply packet
回复包
public void putSent(OutPacket out)
out
- public boolean isReplied(OutPacket packet, boolean add)
packet
- packet to be checkout
要检查的包add
- if is true, then while this packet is null, add hash of this packet, or don't add
如果为true,则当这个包不存在时,添加这个包的hash,否则不添加
Packet.hashCode()
,
Packet.equals(Object);
public boolean isDuplicated(InPacket packet)
packet
- InPacket subclass
InPacket子类
public InPacket parseIn(int supportedFamily, ByteBuffer buf, QQUser user, boolean debug) throws PacketParseException
supportedFamily
- supported protocol family
支持的协议族buf
- ByteBuffer objcet
ByteBuffer对象debug
- true means debug mode, debug mode will overlook reduplicated packet
true表示调试模式,调试模式下会忽略重复包
PacketParseException
- if packet format wrong
如果包格式不对public OutPacket parseOut(int supportedFamily, ByteBuffer buf, QQUser user) throws PacketParseException
buf
- type
-
PacketParseException
public boolean relocate(int relocateFamily, ByteBuffer buf)
relocateFamily
- relocate use protocol family
重定位使用的协议族buf
- buffer
缓冲区
|
JML | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |