当前位置: 首页>>代码示例>>Java>>正文


Java LineDelimiter.AUTO属性代码示例

本文整理汇总了Java中org.apache.mina.filter.codec.textline.LineDelimiter.AUTO属性的典型用法代码示例。如果您正苦于以下问题:Java LineDelimiter.AUTO属性的具体用法?Java LineDelimiter.AUTO怎么用?Java LineDelimiter.AUTO使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在org.apache.mina.filter.codec.textline.LineDelimiter的用法示例。


在下文中一共展示了LineDelimiter.AUTO属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: getLineDelimiterParameter

private static LineDelimiter getLineDelimiterParameter(TextLineDelimiter delimiter) {
    if (delimiter == null) {
        return LineDelimiter.DEFAULT;
    }

    switch (delimiter) {
    case DEFAULT:
        return LineDelimiter.DEFAULT;
    case AUTO:
        return LineDelimiter.AUTO;
    case UNIX:
        return LineDelimiter.UNIX;
    case WINDOWS:
        return LineDelimiter.WINDOWS;
    case MAC:
        return LineDelimiter.MAC;
    default:
        throw new IllegalArgumentException("Unknown textline delimiter: " + delimiter);
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:20,代码来源:MinaComponent.java

示例2: getLineDelimiterParameter

private static LineDelimiter getLineDelimiterParameter(Mina2TextLineDelimiter delimiter) {
    if (delimiter == null) {
        return LineDelimiter.DEFAULT;
    }

    switch (delimiter) {
    case DEFAULT:
        return LineDelimiter.DEFAULT;
    case AUTO:
        return LineDelimiter.AUTO;
    case UNIX:
        return LineDelimiter.UNIX;
    case WINDOWS:
        return LineDelimiter.WINDOWS;
    case MAC:
        return LineDelimiter.MAC;
    default:
        throw new IllegalArgumentException("Unknown textline delimiter: " + delimiter);
    }
}
 
开发者ID:HydAu,项目名称:Camel,代码行数:20,代码来源:Mina2Producer.java

示例3: MinaCubeClient

public MinaCubeClient(String hostname, int port) {
    this.hostname = hostname;
    this.port = port;
    connector = new NioSocketConnector(1);
    connector.setConnectTimeoutMillis(2000);

    connector.getFilterChain().addLast("logger", new LoggingFilter());
    TextLineCodecFactory codecFactory = new TextLineCodecFactory(UTF_8, LineDelimiter.CRLF, LineDelimiter.AUTO);
    codecFactory.setDecoderMaxLineLength(4096);
    codecFactory.setEncoderMaxLineLength(4096);
    connector.getFilterChain().addLast("codec", new ProtocolCodecFilter(codecFactory));

    handler = new ConnectHandler();
    connector.setHandler(handler);
}
 
开发者ID:spinscale,项目名称:maxcube-java,代码行数:15,代码来源:MinaCubeClient.java

示例4: TextLineConsumer

/**
   * Creates a new instance with the specified <tt>charset</tt>
   * the specified <tt>delimiter</tt> and the specified
   * {@link IoFilterCodec}. Delimiter
   * {@link LineDelimiter#AUTO} is not allowed.
   */
  public TextLineConsumer( Charset charset, LineDelimiter delimiter, IoFilterCodec codec )
  {
      if( charset == null )
      {
          throw new NullPointerException( "charset" );
      }
      if( delimiter == null )
      {
          throw new NullPointerException( "delimiter" );
      }
      if( delimiter == LineDelimiter.AUTO )
      {
      	throw new IllegalArgumentException("LineDelimiter.AUTO is not allowed");
      }

      this.codec = codec;
      
      // Convert delimiter to ByteBuffer.
      delimBuf = IoBuffer.allocate( 2 ).setAutoExpand( true );
      try 
      {
	delimBuf.putString( delimiter.getValue(), charset.newEncoder() );
} 
      catch (CharacterCodingException e) 
      {
	throw new RuntimeException(e);
}
      delimBuf.flip();
  }
 
开发者ID:edeoliveira,项目名称:Mailster,代码行数:35,代码来源:TextLineConsumer.java

示例5: TextLineDecoder

/**
 * Creates a new instance with the current default {@link Charset} and
 * {@link LineDelimiter#AUTO} delimiter.
 */
public TextLineDecoder() {
  this(LineDelimiter.AUTO);
}
 
开发者ID:blackberry,项目名称:hadoop-logdriver,代码行数:7,代码来源:TextLineDecoder.java

示例6: TextLineCodecFactory

/**
 * 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);
}
 
开发者ID:blackberry,项目名称:hadoop-logdriver,代码行数:12,代码来源:TextLineCodecFactory.java


注:本文中的org.apache.mina.filter.codec.textline.LineDelimiter.AUTO属性示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。