public class PacketInputStream extends DataInputStream
Message). It extends the DataInputStream by
a single method that reads a (short) Message. During packet reading, the
length of the data packet in the four bytes with index 46-49 determines
how many bytes are read to complete the data array.in| Constructor and Description |
|---|
PacketInputStream(InputStream in)
Wraps a packet input stream on top of a data output stream.
|
| Modifier and Type | Method and Description |
|---|---|
protected Message |
gotPacket(int overall,
int offset,
short flags,
int id,
String src,
String dest,
byte[] data)
This method should be populated if multi-packet receiving is needed.
|
Message |
readMessage()
Reads a short GREGOR message from the stream.
|
read, read, readBoolean, readByte, readChar, readDouble, readFloat, readFully, readFully, readInt, readLine, readLong, readShort, readUnsignedByte, readUnsignedShort, readUTF, readUTF, skipBytesavailable, close, mark, markSupported, read, reset, skippublic PacketInputStream(InputStream in)
public Message readMessage() throws IOException
IOExceptionprotected Message gotPacket(int overall, int offset, short flags, int id, String src, String dest, byte[] data) throws IOException
IOException