cc.otavia.handler.codec.string
package 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 MessageToByteEncodertrait Message2ByteEncoderclass ChannelHandlerAdaptertrait ChannelHandlerclass Objecttrait Matchableclass AnyShow all
A class to represent line separators in different environments.
A class to represent line separators in different environments.
Attributes
- Companion
- object
- Supertypes
-
class Objecttrait Matchableclass Any
object LineSeparator
Attributes
- Companion
- class
- Supertypes
-
class Objecttrait Matchableclass Any
- Self type
-
LineSeparator.type
class StringDecoder(charset: Charset) extends ByteToMessageDecoder
Attributes
- Supertypes
-
class ByteToMessageDecodertrait Byte2MessageDecoderclass ChannelHandlerAdaptertrait ChannelHandlerclass Objecttrait Matchableclass AnyShow all
class StringEncoder(charset: Charset) extends MessageToByteEncoder
Attributes
- Supertypes
-
class MessageToByteEncodertrait Message2ByteEncoderclass ChannelHandlerAdaptertrait ChannelHandlerclass Objecttrait Matchableclass AnyShow all
In this article