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 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.
-
-
-
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 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 java.lang.Exception
- Specified by:
isEndOfInput
in interfaceio.netty.handler.stream.ChunkedInput<io.netty.buffer.ByteBuf>
- Throws:
java.lang.Exception
-
close
public void close() throws java.lang.Exception
- Specified by:
close
in interfaceio.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 interfaceio.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 interfaceio.netty.handler.stream.ChunkedInput<io.netty.buffer.ByteBuf>
- Throws:
java.lang.Exception
-
length
public long length()
- Specified by:
length
in interfaceio.netty.handler.stream.ChunkedInput<io.netty.buffer.ByteBuf>
-
progress
public long progress()
- Specified by:
progress
in interfaceio.netty.handler.stream.ChunkedInput<io.netty.buffer.ByteBuf>
-
-