Class ChunkedMessageInput

java.lang.Object
org.drasyl.handler.stream.ChunkedMessageInput
All Implemented Interfaces:
io.netty.handler.stream.ChunkedInput<MessageChunk>

@Deprecated public class ChunkedMessageInput extends Object implements io.netty.handler.stream.ChunkedInput<MessageChunk>
Deprecated.
Wraps each chunk of the specified io.netty.handler.stream.ChunkedInput<io.netty.buffer.ByteBuf> into a series of sortable MessageChunks, allowing the receiver to reassemble the ByteBuf in correct order. Useful for protocols that does provide message ordering (like UDP or drasyl).
  ChannelPipeline p = ...;
  ...
  p.addLast("encoder", new MessageChunkEncoder());
  p.addLast("chunked_write", new ChunkedWriteHandler);
  p.addLast("decoder", new MessageChunkDecoder());
  p.addLast("buffer", new MessageChunksBuffer(65536, 5000));
  p.addLast("aggregator", new ChunkedMessageAggregator(65536));
  ...
  p.addLast("handler", new MyReassembledMessageHandler());
  
  • Constructor Details

    • ChunkedMessageInput

      public ChunkedMessageInput(io.netty.handler.stream.ChunkedInput<io.netty.buffer.ByteBuf> input)
      Deprecated.
  • Method Details

    • isEndOfInput

      public boolean isEndOfInput() throws Exception
      Deprecated.
      Specified by:
      isEndOfInput in interface io.netty.handler.stream.ChunkedInput<MessageChunk>
      Throws:
      Exception
    • close

      public void close() throws Exception
      Deprecated.
      Specified by:
      close in interface io.netty.handler.stream.ChunkedInput<MessageChunk>
      Throws:
      Exception
    • readChunk

      public MessageChunk readChunk(io.netty.channel.ChannelHandlerContext ctx) throws Exception
      Deprecated.
      Specified by:
      readChunk in interface io.netty.handler.stream.ChunkedInput<MessageChunk>
      Throws:
      Exception
    • readChunk

      public MessageChunk readChunk(io.netty.buffer.ByteBufAllocator allocator) throws Exception
      Deprecated.
      Specified by:
      readChunk in interface io.netty.handler.stream.ChunkedInput<MessageChunk>
      Throws:
      Exception
    • length

      public long length()
      Deprecated.
      Specified by:
      length in interface io.netty.handler.stream.ChunkedInput<MessageChunk>
    • progress

      public long progress()
      Deprecated.
      Specified by:
      progress in interface io.netty.handler.stream.ChunkedInput<MessageChunk>