|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectme.edwards.des.net.packet.Packet
me.edwards.des.net.packet.PacketInv
public class PacketInv
Inventory Packet
This packet is sent to advertise knowledge of a particular piece, or pieces,
of data.
Created on: Nov 3, 2015 at 9:17:44 AM
Nested Class Summary | |
---|---|
protected static class |
PacketInv.InvVector
Inventory Vector contains the hash of the inventory object and its type. |
Nested classes/interfaces inherited from class me.edwards.des.net.packet.Packet |
---|
Packet.PacketTypes |
Field Summary | |
---|---|
static int |
VECTOR_BALLOT
The Vector type for a Ballot Object |
static int |
VECTOR_BLOCK
The Vector type for a Block Object |
private java.util.ArrayList<PacketInv.InvVector> |
vectors
|
Constructor Summary | |
---|---|
PacketInv()
Creates new PacketInv |
|
PacketInv(byte[] binary)
Creates new PacketInv from binary data |
Method Summary | |
---|---|
void |
addInv(java.lang.Object invObject)
Adds an inventory object to this Packet. |
byte[] |
getBinary()
Returns the binary payload of this Packet as a byte array. |
java.lang.String |
getHash(int index)
Returns the hash of the vector at the specified index. |
int |
getSize()
Returns the number of vectors in this Packet |
int |
getType(int index)
Returns the type of the vector at the specified index. |
Methods inherited from class me.edwards.des.net.packet.Packet |
---|
getID, lookup, toHex, toString, toString |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int VECTOR_BALLOT
public static final int VECTOR_BLOCK
private java.util.ArrayList<PacketInv.InvVector> vectors
Constructor Detail |
---|
public PacketInv()
public PacketInv(byte[] binary)
binary
- Packet binary data as byte arrayMethod Detail |
---|
public int getSize()
public int getType(int index)
index
- Index of inventory vector
public java.lang.String getHash(int index)
index
- Index of inventory vector
public void addInv(java.lang.Object invObject)
invObject
- Object to add to inventory
java.lang.RuntimeException
- Thrown if the invObject is not a valid typepublic byte[] getBinary()
Packet
getBinary
in class Packet
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |