Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.mina.filter.codec.textline
Class TextLineEncoder

    java.lang.Object
      org.apache.mina.filter.codec.ProtocolEncoderAdapter
          org.apache.mina.filter.codec.textline.TextLineEncoder

All Implemented Interfaces:
  ProtocolEncoder

    public class TextLineEncoder

extends ProtocolEncoderAdapter

A `ProtocolEncoder` which encodes a string into a text line which ends with the delimiter.

Version:
  $Rev: 555855 $, $Date: 2007-07-13 05:19:00 +0200 (Fri, 13 Jul 2007) $,
Author:
  The Apache Directory Project (mina-dev@directory.apache.org)

Constructor Summary
`TextLineEncoder()`
`TextLineEncoder(Charset charset)`
`TextLineEncoder(Charset charset, LineDelimiter delimiter)`
`TextLineEncoder(LineDelimiter delimiter)`

Method Summary
`void` | `dispose()`
`void` | `encode(IoSession session, Object message, ProtocolEncoderOutput out)` Encodes higher-level message objects into binary or protocol-specific data.
`int` | `getMaxLineLength()` Returns the allowed maximum size of the encoded line.
`void` | `setMaxLineLength(int maxLineLength)` Sets the allowed maximum size of the encoded line.

Methods inherited from class org.apache.mina.filter.codec.ProtocolEncoderAdapter
`dispose`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### TextLineEncoder

    public TextLineEncoder()

### TextLineEncoder

    public TextLineEncoder(LineDelimiter delimiter)

### TextLineEncoder

    public TextLineEncoder(Charset charset)

### TextLineEncoder

    public TextLineEncoder(Charset charset,
                           LineDelimiter delimiter)

Method Detail

### getMaxLineLength

    public int getMaxLineLength()

  Returns the allowed maximum size of the encoded line. If the size of the encoded line exceeds this value, the encoder will throw a `IllegalArgumentException`. The default value is `Integer.MAX_VALUE`.

### setMaxLineLength

    public void setMaxLineLength(int maxLineLength)

  Sets the allowed maximum size of the encoded line. If the size of the encoded line exceeds this value, the encoder will throw a `IllegalArgumentException`. The default value is `Integer.MAX_VALUE`.

### encode

    public void encode(IoSession session,
                       Object message,
                       ProtocolEncoderOutput out)
                throws Exception

  Description copied from interface: `ProtocolEncoder`
  Encodes higher-level message objects into binary or protocol-specific data. MINA invokes `ProtocolEncoder.encode(IoSession, Object, ProtocolEncoderOutput)` method with message which is popped from the session write queue, and then the encoder implementation puts encoded `ByteBuffer`s into `ProtocolEncoderOutput`.

  Throws:
    `Exception` - if the message violated protocol specification

### dispose

    public void dispose()
                 throws Exception

  Throws:
    `Exception`

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2004-2008 Apache MINA Project. All Rights Reserved.