public abstract class WritablePacket<T extends Client<Connection<T>>>
extends java.lang.Object
| Modifier | Constructor and Description |
|---|---|
protected |
WritablePacket() |
| Modifier and Type | Method and Description |
|---|---|
protected int |
size(T client) |
java.lang.String |
toString() |
protected abstract boolean |
write(T client,
java.nio.ByteBuffer buffer)
Writes the data into the packet
|
protected void |
writeSizedString(java.lang.CharSequence text,
java.nio.ByteBuffer buffer)
Write String to the buffer preceded by a short 16 bit with String length and no null termination.
|
protected void |
writeString(java.lang.CharSequence text,
java.nio.ByteBuffer buffer)
Write a String to the buffer with a null termination (\000).
|
protected final void writeString(java.lang.CharSequence text,
java.nio.ByteBuffer buffer)
text - to be writtenbuffer - where the text will be writtenprotected final void writeSizedString(java.lang.CharSequence text,
java.nio.ByteBuffer buffer)
text - to be writtenbuffer - where the text will be writtenprotected int size(T client)
client - the clientpublic java.lang.String toString()
toString in class java.lang.Objectprotected abstract boolean write(T client, java.nio.ByteBuffer buffer)
client - client to send databuffer - buffer to write data to