public final class TcpCodecs extends Object
TcpNetServerConnectionFactory server = new TcpNetServerConnectionFactory(1234); server.setSerializer(TcpCodecs.lf()); server.setDeserializer(TcpCodecs.lf()); ...
Modifier and Type | Method and Description |
---|---|
static ByteArrayCrLfSerializer |
crlf()
Return a serializer with the default max message size for deserialization.
|
static ByteArrayCrLfSerializer |
crlf(int maxMessageSize)
Return a serializer with the provided max message size for deserialization.
|
static ByteArrayLengthHeaderSerializer |
lengthHeader(int bytes)
Return a serializer with the default max message size for deserialization.
|
static ByteArrayLengthHeaderSerializer |
lengthHeader1()
Return a serializer with the default max message size for deserialization.
|
static ByteArrayLengthHeaderSerializer |
lengthHeader1(int maxMessageSize)
Return a serializer with the provided max message size for deserialization.
|
static ByteArrayLengthHeaderSerializer |
lengthHeader2()
Return a serializer with the default max message size for deserialization.
|
static ByteArrayLengthHeaderSerializer |
lengthHeader2(int maxMessageSize)
Return a serializer with the provided max message size for deserialization.
|
static ByteArrayLengthHeaderSerializer |
lengthHeader4()
Return a serializer with the default max message size for deserialization.
|
static ByteArrayLengthHeaderSerializer |
lengthHeader4(int maxMessageSize)
Return a serializer with the provided max message size for deserialization.
|
static ByteArrayLfSerializer |
lf()
Return a serializer with the default max message size for deserialization.
|
static ByteArrayLfSerializer |
lf(int maxMessageSize)
Return a serializer with the provided max message size for deserialization.
|
static ByteArrayRawSerializer |
raw()
Return a serializer with the default max message size for deserialization.
|
static ByteArrayRawSerializer |
raw(int maxMessageSize)
Return a serializer with the provided max message size for deserialization.
|
static ByteArraySingleTerminatorSerializer |
singleTerminator(byte terminator)
Return a serializer with the default max message size for deserialization.
|
static ByteArraySingleTerminatorSerializer |
singleTerminator(byte terminator,
int maxMessageSize)
Return a serializer with the provided max message size for deserialization.
|
static ByteArrayStxEtxSerializer |
stxetx()
Return a serializer with the default max message size for deserialization.
|
static ByteArrayStxEtxSerializer |
stxetx(int maxMessageSize)
Return a serializer with the provided max message size for deserialization.
|
public static ByteArrayCrLfSerializer crlf()
ByteArrayCrLfSerializer
.AbstractByteArraySerializer.DEFAULT_MAX_MESSAGE_SIZE
public static ByteArrayLfSerializer lf()
ByteArrayLfSerializer
.AbstractByteArraySerializer.DEFAULT_MAX_MESSAGE_SIZE
public static ByteArrayRawSerializer raw()
ByteArrayRawSerializer
.AbstractByteArraySerializer.DEFAULT_MAX_MESSAGE_SIZE
public static ByteArrayStxEtxSerializer stxetx()
ByteArrayStxEtxSerializer
.AbstractByteArraySerializer.DEFAULT_MAX_MESSAGE_SIZE
public static ByteArraySingleTerminatorSerializer singleTerminator(byte terminator)
terminator
- the terminator indicating message end.ByteArraySingleTerminatorSerializer
using the supplied
terminator.AbstractByteArraySerializer.DEFAULT_MAX_MESSAGE_SIZE
public static ByteArrayLengthHeaderSerializer lengthHeader1()
ByteArrayLengthHeaderSerializer
with a 1 byte header.AbstractByteArraySerializer.DEFAULT_MAX_MESSAGE_SIZE
public static ByteArrayLengthHeaderSerializer lengthHeader2()
ByteArrayLengthHeaderSerializer
with a 2 byte header.AbstractByteArraySerializer.DEFAULT_MAX_MESSAGE_SIZE
public static ByteArrayLengthHeaderSerializer lengthHeader4()
ByteArrayLengthHeaderSerializer
with a 4 byte header.AbstractByteArraySerializer.DEFAULT_MAX_MESSAGE_SIZE
public static ByteArrayLengthHeaderSerializer lengthHeader(int bytes)
bytes
- header length.ByteArrayLengthHeaderSerializer
with a 1, 2 or 4 byte header.AbstractByteArraySerializer.DEFAULT_MAX_MESSAGE_SIZE
public static ByteArrayCrLfSerializer crlf(int maxMessageSize)
maxMessageSize
- the max message size.ByteArrayCrLfSerializer
.public static ByteArrayLfSerializer lf(int maxMessageSize)
maxMessageSize
- the max message size.ByteArrayLfSerializer
.public static ByteArrayRawSerializer raw(int maxMessageSize)
maxMessageSize
- the max message size.ByteArrayRawSerializer
.public static ByteArrayStxEtxSerializer stxetx(int maxMessageSize)
maxMessageSize
- the max message size.ByteArrayStxEtxSerializer
.public static ByteArraySingleTerminatorSerializer singleTerminator(byte terminator, int maxMessageSize)
terminator
- the terminator indicating message end.maxMessageSize
- the max message size.ByteArraySingleTerminatorSerializer
using the supplied
terminator.public static ByteArrayLengthHeaderSerializer lengthHeader1(int maxMessageSize)
maxMessageSize
- the max message size.ByteArrayLengthHeaderSerializer
with a 1 byte header.public static ByteArrayLengthHeaderSerializer lengthHeader2(int maxMessageSize)
maxMessageSize
- the max message size.ByteArrayLengthHeaderSerializer
with a 2 byte header.public static ByteArrayLengthHeaderSerializer lengthHeader4(int maxMessageSize)
maxMessageSize
- the max message size.ByteArrayLengthHeaderSerializer
with a 4 byte header.