public class DiscoverRequest 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 |
DiscoverRequest(byte[] packet)
Constructor (typically used by server) with a byte[] parameter containing the Packet received.
|
|
DiscoverRequest(java.lang.String filename)
Constructor with filename (typically used by client).
|
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 DiscoverRequest(java.lang.String filename) throws InternalError
filename
- Name of the file you want a server list of.InternalError
protected DiscoverRequest(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 java.lang.String getFilename()