public class SizeResponse extends Payload
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
filename |
private static int |
FILENAME_POSITION |
private static int |
TOTAL_SIZE_POSITION |
private long |
totalSize |
PAYLOAD_SIZE_POSITION, PAYLOAD_START_POSITION, requestResponseCode
Modifier | Constructor and Description |
---|---|
protected |
SizeResponse(byte[] packet)
Constructor (typically used by client) with Packet received as parameter.
|
|
SizeResponse(java.lang.String filename,
long totalSize)
Constructor (typically used by server) with informations about file part to send as parameters.
|
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getFilename()
filename getter.
|
long |
getTotalSize()
totalSize getter.
|
protected byte[] |
toPacket()
Returns a byte[] containing Packet with padding.
|
getPayloadSize, getRequestResponseCode, setPayloadSize
private java.lang.String filename
private long totalSize
private static final int TOTAL_SIZE_POSITION
private static final int FILENAME_POSITION
public SizeResponse(java.lang.String filename, long totalSize) throws InternalError
filename
- name of the filetotalSize
- size of the fileInternalError
protected SizeResponse(byte[] packet) throws TransmissionError, SizeError, ProtocolError, InternalError
packet
- the full Packet receivedSizeError
InternalError
TransmissionError
ProtocolError
protected byte[] toPacket() throws InternalError
toPacket
in class Payload
InternalError
public java.lang.String getFilename()
public long getTotalSize()