Class ChunkedBlobStream

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

    public class ChunkedBlobStream
    extends Object
    implements io.netty.handler.stream.ChunkedInput<io.netty.buffer.ByteBuf>
    • Constructor Detail

      • ChunkedBlobStream

        public ChunkedBlobStream​(String clientId,
                                 String blobId,
                                 long length,
                                 InputStream in,
                                 int chunkSize)
        Parameters:
        clientId - identifier for client requesting the blob
        blobId - blob identifier
        length - blob length
        in - blob stream
        chunkSize - the number of bytes to fetch on each readChunk(ChannelHandlerContext) call
    • Method Detail

      • transferredBytes

        public long transferredBytes()
        Returns the number of transferred bytes.
      • isEndOfInput

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

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

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

        public io.netty.buffer.ByteBuf readChunk​(io.netty.buffer.ByteBufAllocator allocator)
                                          throws Exception
        Specified by:
        readChunk in interface io.netty.handler.stream.ChunkedInput<io.netty.buffer.ByteBuf>
        Throws:
        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>