cc.otavia.handler.codec.string

Members list

Type members

Classlikes

class LineEncoder(lineSeparator: Array[Byte], charset: Charset) extends MessageToByteEncoder

Apply a line separator to the requested String and encode it into a AdaptiveBuffer. A typical setup for a text-based line protocol in a TCP/IP socket would be:

Apply a line separator to the requested String and encode it into a AdaptiveBuffer. A typical setup for a text-based line protocol in a TCP/IP socket would be:

ChannelPipeline pipeline = ...

// Encoder

pipeline.addLast("lineEncoder", new LineEncoder(LineSeparator.UNIX, StandardCharsets.UTF_8))

and then you can use a String as a message:

pipeline.write("Did you say '" + msg + "'?")

Value parameters

charset

message encoder charset

lineSeparator

separator of each message

Attributes

Supertypes
class Object
trait Matchable
class Any
Show all
class LineSeparator(val value: String)

A class to represent line separators in different environments.

A class to represent line separators in different environments.

Attributes

Companion
object
Supertypes
class Object
trait Matchable
class Any
object LineSeparator

Attributes

Companion
class
Supertypes
class Object
trait Matchable
class Any
Self type
class StringDecoder(charset: Charset) extends ByteToMessageDecoder

Attributes

Supertypes
class Object
trait Matchable
class Any
Show all
class StringEncoder(charset: Charset) extends MessageToByteEncoder

Attributes

Supertypes
class Object
trait Matchable
class Any
Show all