|
JML | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
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 All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |