Package arc.net
Interface NetSerializer
- All Known Implementing Classes:
ArcNetProvider.PacketSerializer
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 int
The fixed number of bytes that will be written bywriteLength(ByteBuffer, int)
and read byreadLength(ByteBuffer)
.read
(ByteBuffer buffer) default int
readLength
(ByteBuffer buffer) void
write
(ByteBuffer buffer, Object object) default void
writeLength
(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
-