Class ClajServerSerializer
java.lang.Object
com.xpdustry.claj.server.ClajServerSerializer
- All Implemented Interfaces:
arc.net.NetSerializer, com.xpdustry.claj.common.net.FrameworkSerializer
public class ClajServerSerializer
extends Object
implements arc.net.NetSerializer, com.xpdustry.claj.common.net.FrameworkSerializer
-
Field Summary
FieldsModifier and TypeFieldDescriptionbooleanstatic booleanAs there is only one serializer for CLaJ servers, the fast path can be used.protected static final ThreadLocal<com.xpdustry.claj.common.packets.RawPacket> protected static final ThreadLocal<arc.util.io.ByteBufferInput> protected static final ThreadLocal<arc.util.io.ByteBufferOutput> -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionread(ByteBuffer buffer) com.xpdustry.claj.common.packets.PacketreadClaj(ByteBuffer buffer) com.xpdustry.claj.common.packets.RawPacketreadRaw(ByteBuffer buffer) readString(ByteBuffer buffer) Note that an empty string is always returned.voidwrite(ByteBuffer buffer, Object object) voidwriteClaj(ByteBuffer buffer, com.xpdustry.claj.common.packets.Packet packet) voidwriteString(ByteBuffer buffer, String str) Methods inherited from class Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.xpdustry.claj.common.net.FrameworkSerializer
readFramework, writeFrameworkMethods inherited from interface arc.net.NetSerializer
getLengthLength, readLength, writeLength
-
Field Details
-
read
-
write
-
raw
-
FAST_THREAD_LOCAL
public static boolean FAST_THREAD_LOCALAs there is only one serializer for CLaJ servers, the fast path can be used.Remember to disable it, if using the serializer elsewhere. Indeed, the fast path is only efficient if a single thread uses it frequently.
-
networkSpeed
-
packetCounter
-
decodeClaj
public boolean decodeClaj
-
-
Constructor Details
-
ClajServerSerializer
public ClajServerSerializer() -
ClajServerSerializer
-
-
Method Details
-
read
- Specified by:
readin interfacearc.net.NetSerializer
-
readString
Note that an empty string is always returned. -
readClaj
-
readRaw
-
write
- Specified by:
writein interfacearc.net.NetSerializer
-
writeClaj
-
writeString
-