Tabnine Logo
TextLineDecoder
Code IndexAdd Tabnine to your IDE (free)

How to use
TextLineDecoder
in
org.apache.mina.filter.codec.textline

Best Java code snippets using org.apache.mina.filter.codec.textline.TextLineDecoder (Showing top 20 results out of 315)

origin: org.apache.mina/mina-core

/**
 * {@inheritDoc}
 */
@Override
public void decode(IoSession session, IoBuffer in, ProtocolDecoderOutput out) throws Exception {
  Context ctx = getContext(session);
  if (LineDelimiter.AUTO.equals(delimiter)) {
    decodeAuto(ctx, session, in, out);
  } else {
    decodeNormal(ctx, session, in, out);
  }
}
origin: org.apache.mina/mina-core

/**
 * @return the allowed maximum size of the line to be decoded.
 * If the size of the line to be decoded exceeds this value, the
 * decoder will throw a {@link BufferDataException}.  The default
 * value is <tt>1024</tt> (1KB).
 * <p>
 * This method does the same job with {@link TextLineDecoder#getMaxLineLength()}.
 */
public int getDecoderMaxLineLength() {
  return decoder.getMaxLineLength();
}
origin: kaazing/gateway

  /**
   * Sets the allowed maximum size of the line to be decoded.
   * If the size of the line to be decoded exceeds this value, the
   * decoder will throw a {@link BufferDataException}.  The default
   * value is <tt>1024</tt> (1KB).
   * <p>
   * This method does the same job with {@link TextLineDecoder#setMaxLineLength(int)}.
   */
  public void setDecoderMaxLineLength(int maxLineLength) {
    decoder.setMaxLineLength(maxLineLength);
  }
}
origin: org.apache.mina/mina-core

/**
 * Creates a new instance of TextLineCodecFactory.  This constructor
 * provides more flexibility for the developer.
 *
 * @param charset
 *  The charset to use in the encoding and decoding
 * @param encodingDelimiter
 *  The line delimeter for the encoder
 * @param decodingDelimiter
 *  The line delimeter for the decoder
 */
public TextLineCodecFactory(Charset charset, LineDelimiter encodingDelimiter, LineDelimiter decodingDelimiter) {
  encoder = new TextLineEncoder(charset, encodingDelimiter);
  decoder = new TextLineDecoder(charset, decodingDelimiter);
}
origin: org.apache.mina/mina-core

  writeText(session, str, out);
} finally {
  buf.clear();
origin: org.apache.mina/mina-core

/**
 * Creates a new instance with the specified {@link Charset}.  The
 * encoder uses a UNIX {@link LineDelimiter} and the decoder uses
 * the AUTO {@link LineDelimiter}.
 *
 * @param charset The charset to use in the encoding and decoding
 */
public TextLineCodecFactory(Charset charset) {
  encoder = new TextLineEncoder(charset, LineDelimiter.UNIX);
  decoder = new TextLineDecoder(charset, LineDelimiter.AUTO);
}
origin: org.apache.directory.api/api-ldap-client-all

  writeText(session, str, out);
} finally {
  buf.clear();
origin: kaazing/gateway

public void decode(IoSession session, IoBuffer in,
    ProtocolDecoderOutput out) throws Exception {
  Context ctx = getContext(session);
  if (LineDelimiter.AUTO.equals(delimiter)) {
    decodeAuto(ctx, session, in, out);
  } else {
    decodeNormal(ctx, session, in, out);
  }
}
origin: org.apache.directory.api/api-ldap-client-all

/**
 * Creates a new instance with the specified {@link Charset}.  The
 * encoder uses a UNIX {@link LineDelimiter} and the decoder uses
 * the AUTO {@link LineDelimiter}.
 *
 * @param charset The charset to use in the encoding and decoding
 */
public TextLineCodecFactory(Charset charset) {
  encoder = new TextLineEncoder(charset, LineDelimiter.UNIX);
  decoder = new TextLineDecoder(charset, LineDelimiter.AUTO);
}
origin: org.apache.directory.mina/mina-core

/**
 * Returns the allowed maximum size of the line to be decoded.
 * If the size of the line to be decoded exceeds this value, the
 * decoder will throw a {@link BufferDataException}.  The default
 * value is <tt>1024</tt> (1KB).
 * <p>
 * This method does the same job with {@link TextLineDecoder#getMaxLineLength()}.
 */
public int getDecoderMaxLineLength()
{
  return decoder.getMaxLineLength();
}

origin: org.apache.mina/mina-core

  /**
   * Sets the allowed maximum size of the line to be decoded.
   * If the size of the line to be decoded exceeds this value, the
   * decoder will throw a {@link BufferDataException}.  The default
   * value is <tt>1024</tt> (1KB).
   * <p>
   * This method does the same job with {@link TextLineDecoder#setMaxLineLength(int)}.
   * 
   * @param maxLineLength the maximum decoded line length
   */
  public void setDecoderMaxLineLength(int maxLineLength) {
    decoder.setMaxLineLength(maxLineLength);
  }
}
origin: kaazing/gateway

buf.limit(buf.limit() - matchCount);
try {
  writeText(session, buf.getString(ctx.getDecoder()), out);
} finally {
  buf.clear();
origin: org.apache.directory.api/api-ldap-client-all

/**
 * {@inheritDoc}
 */
@Override
public void decode(IoSession session, IoBuffer in, ProtocolDecoderOutput out) throws Exception {
  Context ctx = getContext(session);
  if (LineDelimiter.AUTO.equals(delimiter)) {
    decodeAuto(ctx, session, in, out);
  } else {
    decodeNormal(ctx, session, in, out);
  }
}
origin: org.apache.directory.mina/mina-core

/**
 * Creates a new instance with the specified {@link Charset}.
 */
public TextLineCodecFactory( Charset charset )
{
  encoder = new TextLineEncoder( charset, LineDelimiter.UNIX );
  decoder = new TextLineDecoder( charset, LineDelimiter.AUTO );
}
origin: org.apache.directory.api/api-ldap-client-all

/**
 * @return the allowed maximum size of the line to be decoded.
 * If the size of the line to be decoded exceeds this value, the
 * decoder will throw a {@link BufferDataException}.  The default
 * value is <tt>1024</tt> (1KB).
 * <p>
 * This method does the same job with {@link TextLineDecoder#getMaxLineLength()}.
 */
public int getDecoderMaxLineLength() {
  return decoder.getMaxLineLength();
}
origin: org.apache.directory.mina/mina-core

  /**
   * Sets the allowed maximum size of the line to be decoded.
   * If the size of the line to be decoded exceeds this value, the
   * decoder will throw a {@link BufferDataException}.  The default
   * value is <tt>1024</tt> (1KB).
   * <p>
   * This method does the same job with {@link TextLineDecoder#setMaxLineLength(int)}.
   */
  public void setDecoderMaxLineLength( int maxLineLength )
  {
    decoder.setMaxLineLength( maxLineLength );
  }
}
origin: org.apache.mina/mina-core

  writeText(session, buf.getString(ctx.getDecoder()), out);
} finally {
  buf.clear();
origin: org.apache.directory.mina/mina-core

public void decode( IoSession session, ByteBuffer in,
          ProtocolDecoderOutput out )
    throws Exception
{
  Context ctx = getContext(session);
  
  if( LineDelimiter.AUTO.equals( delimiter ) )
  {
    ctx.setMatchCount(
        decodeAuto(
            in,
            ctx.getBuffer(),
            ctx.getMatchCount(),
            ctx.getDecoder(),
            out ) );
  }
  else
  {
    ctx.setMatchCount(
        decodeNormal(
            in,
            ctx.getBuffer(),
            ctx.getMatchCount(),
            ctx.getDecoder(),
            out ) );
  }
}
origin: kaazing/gateway

/**
 * Creates a new instance with the specified {@link Charset}.  The
 * encoder uses a UNIX {@link LineDelimiter} and the decoder uses
 * the AUTO {@link LineDelimiter}.
 *
 * @param charset
 *  The charset to use in the encoding and decoding
 */
public TextLineCodecFactory(Charset charset) {
  encoder = new TextLineEncoder(charset, LineDelimiter.UNIX);
  decoder = new TextLineDecoder(charset, LineDelimiter.AUTO);
}
origin: kaazing/gateway

/**
 * Returns the allowed maximum size of the line to be decoded.
 * If the size of the line to be decoded exceeds this value, the
 * decoder will throw a {@link BufferDataException}.  The default
 * value is <tt>1024</tt> (1KB).
 * <p>
 * This method does the same job with {@link TextLineDecoder#getMaxLineLength()}.
 */
public int getDecoderMaxLineLength() {
  return decoder.getMaxLineLength();
}
org.apache.mina.filter.codec.textlineTextLineDecoder

Javadoc

A ProtocolDecoder which decodes a text line into a string.

Most used methods

  • <init>
    Creates a new instance with the current default Charsetand the specified delimiter.
  • decodeAuto
    Decode a line using the default delimiter on the current system
  • decodeNormal
    Decode a line using the delimiter defined by the caller
  • getContext
  • getMaxLineLength
  • setMaxLineLength
    Sets the allowed maximum size of the line to be decoded. If the size of the line to be decoded excee
  • writeText
    By default, this method propagates the decoded line of text to ProtocolDecoderOutput#write(Object).

Popular in Java

  • Making http requests using okhttp
  • setScale (BigDecimal)
  • onCreateOptionsMenu (Activity)
  • onRequestPermissionsResult (Fragment)
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • DateFormat (java.text)
    Formats or parses dates and times.This class provides factories for obtaining instances configured f
  • Properties (java.util)
    A Properties object is a Hashtable where the keys and values must be Strings. Each property can have
  • Executors (java.util.concurrent)
    Factory and utility methods for Executor, ExecutorService, ScheduledExecutorService, ThreadFactory,
  • JarFile (java.util.jar)
    JarFile is used to read jar entries and their associated data from jar files.
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • From CI to AI: The AI layer in your organization
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now