me.edwards.des.net.packet
Class PacketVersion
java.lang.Object
me.edwards.des.net.packet.Packet
me.edwards.des.net.packet.PacketVersion
public class PacketVersion
- extends Packet
Version Packet
This is used in the handshake protocol for the DES system and contains
version, block count, and time.
Created on: Oct 17, 2015 at 9:12:01 AM
- Author:
- Matthew Edwards
Method Summary |
byte[] |
getBinary()
Returns the binary payload of this Packet as a byte array. |
int |
getPort()
Return the sender Node's port. |
Version |
getVersion()
Returns the Version of the sender Node. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
version
private Version version
port
private int port
PacketVersion
public PacketVersion(Version version,
int port)
- Creates new PacketVersion
- Parameters:
version
- Node DES Versionport
- Node port
PacketVersion
public PacketVersion(byte[] binary)
- Creates new PacketVersion from binary data
- Parameters:
binary
- Packet binary data as byte array
getVersion
public Version getVersion()
- Returns the Version of the sender Node.
- Returns:
- Version of the sender Node
getPort
public int getPort()
- Return the sender Node's port. Used to set the correct port of the
Connection
.
- Returns:
- Port of the sender Node
getBinary
public byte[] getBinary()
- Description copied from class:
Packet
- Returns the binary payload of this Packet as a byte array.
- Specified by:
getBinary
in class Packet
- Returns:
- Binary payload as a byte array