public class CopyingStreamWindow extends Object implements StreamWindow
Constructor and Description |
---|
CopyingStreamWindow(com.couchbase.client.core.deps.io.netty.buffer.ByteBufAllocator allocator) |
Modifier and Type | Method and Description |
---|---|
void |
add(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buf)
Appends the given buffer to the end of the stream.
|
void |
close()
Releases all buffers owned by the window.
|
byte[] |
getBytes(long startStreamOffset,
long endStreamOffset)
Returns a region of the stream as a byte array.
|
void |
releaseBefore(long releaseStreamOffset)
Forgets any bytes with stream offsets lower then the given offset.
|
String |
toString() |
public CopyingStreamWindow(com.couchbase.client.core.deps.io.netty.buffer.ByteBufAllocator allocator)
public void add(com.couchbase.client.core.deps.io.netty.buffer.ByteBuf buf)
StreamWindow
add
in interface StreamWindow
public void releaseBefore(long releaseStreamOffset)
StreamWindow
releaseBefore
in interface StreamWindow
releaseStreamOffset
- offset relative to the start of the stream.public byte[] getBytes(long startStreamOffset, long endStreamOffset)
StreamWindow
getBytes
in interface StreamWindow
startStreamOffset
- region start offset relative to beginning of stream.endStreamOffset
- region end offset relative to beginning of stream.public void close()
StreamWindow
close
in interface StreamWindow
close
in interface Closeable
close
in interface AutoCloseable
Copyright © 2020 Couchbase, Inc.. All rights reserved.