public class RatioRequest extends Payload
Modifier and Type | Field and Description |
---|---|
private HostItem |
hostItem |
private static int |
HOSTNAME_START_POSITION |
PAYLOAD_SIZE_POSITION, PAYLOAD_START_POSITION, requestResponseCode
Modifier | Constructor and Description |
---|---|
protected |
RatioRequest(byte[] packet)
Constructor (typically used by tracker) with a byte[] parameter containing the Packet received.
|
|
RatioRequest(HostItem hostItem)
Constructor with hostItem (typically used by client/server)
|
Modifier and Type | Method and Description |
---|---|
HostItem |
getHostItem()
HostItem getter.
|
protected byte[] |
toPacket()
Returns a byte[] containing Packet with padding.
|
getPayloadSize, getRequestResponseCode, setPayloadSize
private HostItem hostItem
private static final int HOSTNAME_START_POSITION
public RatioRequest(HostItem hostItem) throws InternalError
hostItem
- Host to get ratio of.InternalError
protected RatioRequest(byte[] packet) throws SizeError, ProtocolError, InternalError, TransmissionError
packet
- the full Packet receivedSizeError
InternalError
ProtocolError
TransmissionError
protected byte[] toPacket() throws InternalError
toPacket
in class Payload
InternalError
public HostItem getHostItem()