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, setPayloadSizepublic SizeRequest(java.lang.String filename)
throws InternalError
filename - name of the file to download. Must not be empty.InternalErrorprotected SizeRequest(byte[] packet)
throws TransmissionError,
SizeError,
ProtocolError,
InternalError
packet - the full Packet receivedSizeErrorInternalErrorProtocolErrorTransmissionErrorprotected byte[] toPacket()
throws InternalError
toPacket in class PayloadInternalErrorpublic java.lang.String getFilename()