Package io.netty.handler.codec.string

Examples of io.netty.handler.codec.string.StringEncoder


        StringDecoder stringDecoder = new StringDecoder();
        registry.bind("length-decoder", lengthDecoder);
        registry.bind("string-decoder", stringDecoder);

        LengthFieldPrepender lengthEncoder = new LengthFieldPrepender(4);
        StringEncoder stringEncoder = new StringEncoder();
        registry.bind("length-encoder", lengthEncoder);
        registry.bind("string-encoder", stringEncoder);

        List<ChannelHandler> decoders = new ArrayList<ChannelHandler>();
        decoders.add(lengthDecoder);
View Full Code Here


    public static ChannelHandlerFactory newStringEncoder(Charset charset, String protocol) {
        if ("udp".equalsIgnoreCase(protocol)) {
            return new ShareableChannelHandlerFactory(new DatagramPacketStringEncoder(charset));
        } else {
            return new ShareableChannelHandlerFactory(new StringEncoder(charset));
        }
    }
View Full Code Here

    }

    @Override
    public void configureNewPipeline(ChannelPipeline pipeline) {
        pipeline.addLast(new StringDecoder(outputCharset))
                .addLast(new StringEncoder(inputCharset));
    }
View Full Code Here

        this.inputCharset = inputCharset;
    }

    @Override
    public void configureNewPipeline(ChannelPipeline pipeline) {
        pipeline.addLast(new StringEncoder(inputCharset))
                .addLast(new StringLineDecoder());
    }
View Full Code Here

  @Override
  public void initChannel(SocketChannel channel) {
    // file no more than 2G
    channel.pipeline()
      .addLast("encoder", new StringEncoder())
      .addLast("handler", fhandler);
  }
View Full Code Here

             .handler(new LoggingHandler(LogLevel.INFO))
             .childHandler(new ChannelInitializer<SocketChannel>() {
                 @Override
                 public void initChannel(SocketChannel ch) throws Exception {
                     ch.pipeline().addLast(
                             new StringEncoder(BufType.BYTE, CharsetUtil.UTF_8),
                             new LineBasedFrameDecoder(8192),
                             new StringDecoder(CharsetUtil.UTF_8),
                             new FileHandler());
                 }
             });
View Full Code Here

             .handler(new ChannelInitializer<RxtxChannel>() {
                 @Override
                 public void initChannel(RxtxChannel ch) throws Exception {
                     ch.pipeline().addLast(
                         new LineBasedFrameDecoder(32768),
                         new StringEncoder(BufType.BYTE),
                         new StringDecoder(),
                         new RxtxClientHandler()
                     );
                 }
             });
View Full Code Here

        // On top of the SSL handler, add the text line codec.
        pipeline.addLast("framer", new DelimiterBasedFrameDecoder(
                8192, Delimiters.lineDelimiter()));
        pipeline.addLast("decoder", new StringDecoder());
        pipeline.addLast("encoder", new StringEncoder(BufType.BYTE));

        // and then business logic.
        pipeline.addLast("handler", new SecureChatServerHandler());
    }
View Full Code Here

        // On top of the SSL handler, add the text line codec.
        pipeline.addLast("framer", new DelimiterBasedFrameDecoder(
                8192, Delimiters.lineDelimiter()));
        pipeline.addLast("decoder", new StringDecoder());
        pipeline.addLast("encoder", new StringEncoder(BufType.BYTE));

        // and then business logic.
        pipeline.addLast("handler", new SecureChatClientHandler());
    }
View Full Code Here

        // Decoders
        pipeline.addLast("frameDecoder", new LineBasedFrameDecoder(1000));
        pipeline.addLast("stringDecoder", new StringDecoder(CharsetUtil.UTF_8));

        // Encoder
        pipeline.addLast("stringEncoder", new StringEncoder(CharsetUtil.UTF_8));

        // Handlers
        pipeline.addLast("botHandler", new ClientHandlerAdapter(Bot.this));
      }
    });
View Full Code Here

TOP

Related Classes of io.netty.handler.codec.string.StringEncoder

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.