games.strategy.net.nio
Class SocketWriteData
java.lang.Object
games.strategy.net.nio.SocketWriteData
public class SocketWriteData
- extends java.lang.Object
A packet of data to be written over the network.
Packets do not correspond to ip packets. A packet is just the data
for one serialized object.
The packet is written over the network as 32 bits indicating the size in bytes, then the data itself.
- Author:
- sgb
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
SocketWriteData
public SocketWriteData(byte[] data,
int count)
size
public int size()
getWriteCalls
public int getWriteCalls()
write
public boolean write(java.nio.channels.SocketChannel channel)
throws java.io.IOException
- Returns:
- true if the write has written the entire message
- Throws:
java.io.IOException
toString
public java.lang.String toString()
- Overrides:
toString in class java.lang.Object