|
JML | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| 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 Packetbuf - ByteBuffer
PacketParseException - if parse error
如果解析出错
protected byte[] getBodyBytes(ByteBuffer buf,
int length)
Packet
getBodyBytes in class DiskInPacketbuf - ByteBufferlength - packet total length
包总长度
protected void parseHeader(ByteBuffer buf)
throws PacketParseException
Packet
parseHeader in class DiskInPacketbuf - ByteBuffer
PacketParseException - if parse error
如果解析出错
protected void parseTail(ByteBuffer buf)
throws PacketParseException
Packet
parseTail in class DiskInPacketbuf - ByteBuffer
PacketParseException - if parse error
如果解析出错protected void putHead(ByteBuffer buf)
Packet
putHead in class DiskInPacketbuf - ByteBuffer object whicn packet need to write into
写入的ByteBuffer对象.protected void putTail(ByteBuffer buf)
Packet
putTail in class DiskInPacketbuf - ByteBuffer object whicn packet need to write into
写入的ByteBuffer对象.protected void putBody(ByteBuffer buf)
Packet
putBody in class DiskInPacketbuf - ByteBuffer
|
JML | ||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||