public class Denied extends Payload
Modifier and Type | Field and Description |
---|---|
private java.lang.String |
filename |
private static int |
FILENAME_POSITION |
private long |
offset |
private static int |
OFFSET_POSITION |
PAYLOAD_SIZE_POSITION, PAYLOAD_START_POSITION, requestResponseCode
Modifier | Constructor and Description |
---|---|
protected |
Denied(byte[] packet)
Constructor (typically used by client) with Packet received as parameter.
|
|
Denied(java.lang.String filename,
long offset)
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 |
getOffset()
offset getter.
|
protected byte[] |
toPacket()
Returns a byte[] containing Packet with padding.
|
getPayloadSize, getRequestResponseCode, setPayloadSize
private java.lang.String filename
private long offset
private static final int OFFSET_POSITION
private static final int FILENAME_POSITION
public Denied(java.lang.String filename, long offset) throws InternalError
filename
- name of the file to sendoffset
- where in the file begins the part we are sendingInternalError
protected Denied(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 getOffset()