Package arc.net
Interface NetSerializer
public interface NetSerializer
Controls how objects are transmitted over the network.
Every client connection on the server uses a separate instance for TCP transmissions and the same instance for UDP ones. Therefore all implementing classes have to be synchronized or made thread-safe otherwise.
-
Method Summary
Modifier and TypeMethodDescriptiondefault intThe fixed number of bytes that will be written bywriteLength(ByteBuffer, int)and read byreadLength(ByteBuffer).read(ByteBuffer buffer) default intreadLength(ByteBuffer buffer) voidwrite(ByteBuffer buffer, Object object) default voidwriteLength(ByteBuffer buffer, int length)
-
Method Details
-
write
-
read
-
getLengthLength
default int getLengthLength()The fixed number of bytes that will be written bywriteLength(ByteBuffer, int)and read byreadLength(ByteBuffer). -
writeLength
-
readLength
-