Class ChunkedBlobStream
- java.lang.Object
-
- org.apache.jackrabbit.oak.segment.standby.codec.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 Summary
Constructors Constructor Description ChunkedBlobStream(String clientId, String blobId, long length, InputStream in, int chunkSize)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidclose()booleanisEndOfInput()longlength()longprogress()io.netty.buffer.ByteBufreadChunk(io.netty.buffer.ByteBufAllocator allocator)io.netty.buffer.ByteBufreadChunk(io.netty.channel.ChannelHandlerContext ctx)longtransferredBytes()Returns the number of transferred bytes.
-
-
-
Constructor Detail
-
ChunkedBlobStream
public ChunkedBlobStream(String clientId, String blobId, long length, InputStream in, int chunkSize)
- Parameters:
clientId- identifier for client requesting the blobblobId- blob identifierlength- blob lengthin- blob streamchunkSize- the number of bytes to fetch on eachreadChunk(ChannelHandlerContext)call
-
-
Method Detail
-
transferredBytes
public long transferredBytes()
Returns the number of transferred bytes.
-
isEndOfInput
public boolean isEndOfInput() throws Exception- Specified by:
isEndOfInputin interfaceio.netty.handler.stream.ChunkedInput<io.netty.buffer.ByteBuf>- Throws:
Exception
-
close
public void close() throws Exception- Specified by:
closein interfaceio.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:
readChunkin interfaceio.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:
readChunkin interfaceio.netty.handler.stream.ChunkedInput<io.netty.buffer.ByteBuf>- Throws:
Exception
-
length
public long length()
- Specified by:
lengthin interfaceio.netty.handler.stream.ChunkedInput<io.netty.buffer.ByteBuf>
-
progress
public long progress()
- Specified by:
progressin interfaceio.netty.handler.stream.ChunkedInput<io.netty.buffer.ByteBuf>
-
-