|
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.Packet
net.sf.jqql.packets.InPacket
net.sf.jqql.packets.DiskInPacket
net.sf.jqql.packets.in.disk.DiskInPacketFragment
public class DiskInPacketFragment
network protocol packet fragment is a part of a packet. Packet of network protocol family may be very big, and the default buffer is as small as QQ.QQ_MAX_PACKET_SIZE. So it's a problem to parse the too big packet. Thus, the too big packet is divided into fragment. General speaking, packet fragment is part of packet body. For the packet fragment has not packet head, the parse must carry on task to set packet command and so on. 网络åè®®æ—包片æ–。包片æ–åªæ˜¯æŸä¸ªåŒ…的一部分,由于网络åè®®æ—的包å¯èƒ½éžå¸¸å¤§ï¼Œè€Œç¼ºçœçš„缓冲区 åªæœ‰QQ.QQ_MAX_PACKET_SIZE大,所以解æžè¿™æ ·è¶…大的包æˆäº†ä¸€ä¸ªé—®é¢˜ã€‚所以会把æŸäº›è¶…大的包 拆æˆåŒ…片æ–处ç†ã€‚通常æ¥è¯´ï¼ŒåŒ…ç‰‡æ–æ˜¯åŒ…ä½“çš„ä¸€éƒ¨åˆ†ã€‚ç”±äºŽåŒ…ç‰‡æ–æ²¡æœ‰åŒ…头,所以解æžå™¨å¿…须担负起 设置包命令ç‰å—段的任务。
Field Summary | |
---|---|
byte[] |
body
|
Fields inherited from class net.sf.jqql.packets.DiskInPacket |
---|
replyCode, replyMessage |
Fields inherited from class net.sf.jqql.packets.Packet |
---|
bodyBuf, bodyDecrypted, command, crypter, ds, duplicated, header, log, sequence, source, user |
Constructor Summary | |
---|---|
DiskInPacketFragment(ByteBuffer buf,
int length,
QQUser user)
|
Method Summary | |
---|---|
protected byte[] |
getBodyBytes(ByteBuffer buf,
int length)
get byte array of packet body 得到包体的å—节数组 |
protected void |
parseBody(ByteBuffer buf)
parse packet body, from begin position of buf è§£æžåŒ…体,从buf的开头ä½ç½®è§£æžèµ· |
protected void |
parseHeader(ByteBuffer buf)
parse packet header from current position of buf 从buf的当å‰ä½ç½®è§£æžåŒ…头 |
protected void |
parseTail(ByteBuffer buf)
parse packet tail from current position of buf 从bufçš„å½“å‰æœªçŸ¥è§£æžåŒ…å°¾ |
protected void |
putBody(ByteBuffer buf)
initialize packet body åˆå§‹åŒ–包体 |
protected void |
putHead(ByteBuffer buf)
change packet header to byte stream, and write into appointed ByteBuffer object. |
protected void |
putTail(ByteBuffer buf)
change packet tail to byte stream, and write into appointed ByteBuffer object. |
Methods inherited from class net.sf.jqql.packets.DiskInPacket |
---|
decryptBody, encryptBody, equals, getCryptographStart, getFamily, getHeadLength, getLength, getTailLength, hashCode |
Methods inherited from class net.sf.jqql.packets.InPacket |
---|
validateHeader |
Methods inherited from class net.sf.jqql.packets.Packet |
---|
dump, getCommand, getHeader, getPacketName, getSequence, getSource, hash, isDuplicated, setDuplicated, setHeader, setSequence |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public byte[] body
Constructor Detail |
---|
public DiskInPacketFragment(ByteBuffer buf, int length, QQUser user) throws PacketParseException
PacketParseException
Method Detail |
---|
protected void parseBody(ByteBuffer buf) throws PacketParseException
Packet
parseBody
in class Packet
buf
- ByteBuffer
PacketParseException
- if parse error
如果解æžå‡ºé”™protected byte[] getBodyBytes(ByteBuffer buf, int length)
Packet
getBodyBytes
in class DiskInPacket
buf
- ByteBufferlength
- packet total length
包总长度
protected void parseHeader(ByteBuffer buf) throws PacketParseException
Packet
parseHeader
in class DiskInPacket
buf
- ByteBuffer
PacketParseException
- if parse error
如果解æžå‡ºé”™protected void parseTail(ByteBuffer buf) throws PacketParseException
Packet
parseTail
in class DiskInPacket
buf
- ByteBuffer
PacketParseException
- if parse error
如果解æžå‡ºé”™protected void putHead(ByteBuffer buf)
Packet
putHead
in class DiskInPacket
buf
- ByteBuffer object whicn packet need to write into
写入的ByteBuffer对象.protected void putTail(ByteBuffer buf)
Packet
putTail
in class DiskInPacket
buf
- ByteBuffer object whicn packet need to write into
写入的ByteBuffer对象.protected void putBody(ByteBuffer buf)
Packet
putBody
in class DiskInPacket
buf
- ByteBuffer
|
JML | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES All Classes | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |