📄 prudppacketrequestannounce.java
字号:
// Decompiled by Jad v1.5.8e2. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://kpdus.tripod.com/jad.html
// Decompiler options: packimports(3) fieldsfirst ansi space
// Source File Name: PRUDPPacketRequestAnnounce.java
package org.gudy.azureus2.core3.tracker.protocol.udp;
import com.aelitis.net.udp.uc.PRUDPPacketRequest;
import java.io.*;
import org.gudy.azureus2.core3.util.ByteFormatter;
public class PRUDPPacketRequestAnnounce extends PRUDPPacketRequest
{
public static final int EV_STARTED = 2;
public static final int EV_STOPPED = 3;
public static final int EV_COMPLETED = 1;
public static final int EV_UPDATE = 0;
protected byte hash[];
protected byte peer_id[];
protected long downloaded;
protected int event;
protected int num_want;
protected long left;
protected short port;
protected long uploaded;
protected int ip_address;
public PRUDPPacketRequestAnnounce(long con_id)
{
super(1, con_id);
}
protected PRUDPPacketRequestAnnounce(DataInputStream is, long con_id, int trans_id)
throws IOException
{
super(1, con_id, trans_id);
hash = new byte[20];
peer_id = new byte[20];
is.read(hash);
is.read(peer_id);
downloaded = is.readLong();
left = is.readLong();
uploaded = is.readLong();
event = is.readInt();
ip_address = is.readInt();
num_want = is.readInt();
port = is.readShort();
}
public byte[] getHash()
{
return hash;
}
public byte[] getPeerId()
{
return peer_id;
}
public long getDownloaded()
{
return downloaded;
}
public int getEvent()
{
return event;
}
public int getNumWant()
{
return num_want;
}
public long getLeft()
{
return left;
}
public short getPort()
{
return port;
}
public long getUploaded()
{
return uploaded;
}
public int getIPAddress()
{
return ip_address;
}
public void setDetails(byte _hash[], byte _peer_id[], long _downloaded, int _event, int _ip_address, int _num_want,
long _left, short _port, long _uploaded)
{
hash = _hash;
peer_id = _peer_id;
downloaded = _downloaded;
event = _event;
ip_address = _ip_address;
num_want = _num_want;
left = _left;
port = _port;
uploaded = _uploaded;
}
public void serialise(DataOutputStream os)
throws IOException
{
super.serialise(os);
os.write(hash);
os.write(peer_id);
os.writeLong(downloaded);
os.writeLong(left);
os.writeLong(uploaded);
os.writeInt(event);
os.writeInt(ip_address);
os.writeInt(num_want);
os.writeShort(port);
}
public String getString()
{
return super.getString().concat("[").concat("hash=").concat(ByteFormatter.nicePrint(hash, true)).concat("peer=").concat(ByteFormatter.nicePrint(peer_id, true)).concat("dl=").concat(String.valueOf(downloaded)).concat("ev=").concat(String.valueOf(event)).concat("ip=").concat(String.valueOf(ip_address)).concat("nw=").concat(String.valueOf(num_want)).concat("left=").concat(String.valueOf(left)).concat("port=").concat(String.valueOf(port)).concat("ul=").concat(String.valueOf(uploaded)).concat("]");
}
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -