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)
StreamWindowadd in interface StreamWindowpublic void releaseBefore(long releaseStreamOffset)
StreamWindowreleaseBefore in interface StreamWindowreleaseStreamOffset - offset relative to the start of the stream.public byte[] getBytes(long startStreamOffset,
long endStreamOffset)
StreamWindowgetBytes in interface StreamWindowstartStreamOffset - region start offset relative to beginning of stream.endStreamOffset - region end offset relative to beginning of stream.public void close()
StreamWindowclose in interface StreamWindowclose in interface Closeableclose in interface AutoCloseableCopyright © 2021 Couchbase, Inc.. All rights reserved.