public class SizeRequest extends Payload
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
filename |
PAYLOAD_SIZE_POSITION, PAYLOAD_START_POSITION, requestResponseCode
Modifier | Constructor and Description |
---|---|
protected |
SizeRequest(byte[] packet)
Constructor (typically used by server) with a byte[] parameter containing the Packet received.
|
|
SizeRequest(java.lang.String filename)
Constructor (typically used by the client) with a filename parameter.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getFilename()
filename getter.
|
protected byte[] |
toPacket()
Returns a byte[] containing Packet with padding.
|
getPayloadSize, getRequestResponseCode, setPayloadSize
public SizeRequest(java.lang.String filename) throws InternalError
filename
- name of the file to download. Must not be empty.InternalError
protected SizeRequest(byte[] packet) throws TransmissionError, SizeError, ProtocolError, InternalError
packet
- the full Packet receivedSizeError
InternalError
ProtocolError
TransmissionError
protected byte[] toPacket() throws InternalError
toPacket
in class Payload
InternalError
public java.lang.String getFilename()