Class WeaveChunkedStream

  • All Implemented Interfaces:
    io.netty.handler.stream.ChunkedInput<io.netty.buffer.ByteBuf>

    public class WeaveChunkedStream
    extends java.lang.Object
    implements io.netty.handler.stream.ChunkedInput<io.netty.buffer.ByteBuf>
    Implementation of ChunkedStream which does not rely on InputStream.available() returning accurate data. It will simply try to fill its buffer by reading several times from the stream and send it whenever the buffer is full or the stream empty.
    • Constructor Detail

      • WeaveChunkedStream

        public WeaveChunkedStream​(java.io.InputStream in,
                                  long size)
    • Method Detail

      • transferredBytes

        public long transferredBytes()
      • isEndOfInput

        public boolean isEndOfInput()
                             throws java.lang.Exception
        Specified by:
        isEndOfInput in interface io.netty.handler.stream.ChunkedInput<io.netty.buffer.ByteBuf>
        Throws:
        java.lang.Exception
      • close

        public void close()
                   throws java.lang.Exception
        Specified by:
        close in interface io.netty.handler.stream.ChunkedInput<io.netty.buffer.ByteBuf>
        Throws:
        java.lang.Exception
      • readChunk

        @Deprecated
        public io.netty.buffer.ByteBuf readChunk​(io.netty.channel.ChannelHandlerContext ctx)
                                          throws java.lang.Exception
        Deprecated.
        Specified by:
        readChunk in interface io.netty.handler.stream.ChunkedInput<io.netty.buffer.ByteBuf>
        Throws:
        java.lang.Exception
      • readChunk

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

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

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