Class ChunkedBlobStream

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

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

      Constructors 
      Constructor Description
      ChunkedBlobStream​(java.lang.String clientId, java.lang.String blobId, long length, java.io.InputStream in, int chunkSize)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void close()  
      boolean isEndOfInput()  
      long length()  
      long progress()  
      io.netty.buffer.ByteBuf readChunk​(io.netty.buffer.ByteBufAllocator allocator)  
      io.netty.buffer.ByteBuf readChunk​(io.netty.channel.ChannelHandlerContext ctx)  
      long transferredBytes()
      Returns the number of transferred bytes.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ChunkedBlobStream

        public ChunkedBlobStream​(java.lang.String clientId,
                                 java.lang.String blobId,
                                 long length,
                                 java.io.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 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

        public io.netty.buffer.ByteBuf readChunk​(io.netty.channel.ChannelHandlerContext ctx)
                                          throws java.lang.Exception
        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>