public class SlicedBuffer extends AbstractBuffer
The sliced buffer provides a view of a subset of an underlying buffer. This buffer operates directly on the Bytes
underlying the child Buffer instance.
| Constructor and Description |
|---|
SlicedBuffer(Buffer root,
Bytes bytes,
int offset,
int initialCapacity,
int maxCapacity) |
| Modifier and Type | Method and Description |
|---|---|
Buffer |
acquire() |
void |
close()
Closes the buffer.
|
Buffer |
compact()
Compacts the buffer, moving bytes from the current position to the end of the buffer to the head of the buffer.
|
Buffer |
duplicate()
Returns a duplicate of the buffer.
|
boolean |
isDirect()
Returns a boolean value indicating whether the buffer is a direct buffer.
|
boolean |
isFile()
Returns a boolean value indicating whether the buffer is backed by a file.
|
boolean |
isReadOnly()
Returns a boolean value indicating whether the buffer is a read-only buffer.
|
boolean |
release() |
Buffer |
root()
Returns the root buffer.
|
asReadOnlyBuffer, bytes, capacity, capacity, clear, flip, flush, hasRemaining, limit, limit, mark, maxCapacity, offset, order, order, position, position, read, read, read, read, read, read, read, readBoolean, readBoolean, readByte, readByte, readChar, readChar, readDouble, readDouble, readFloat, readFloat, readInt, readInt, readLong, readLong, readMedium, readMedium, readShort, readShort, readString, readString, readString, readString, readUnsignedByte, readUnsignedByte, readUnsignedInt, readUnsignedInt, readUnsignedMedium, readUnsignedMedium, readUnsignedShort, readUnsignedShort, readUTF8, readUTF8, references, remaining, reset, rewind, skip, slice, slice, slice, write, write, write, write, write, write, write, writeBoolean, writeBoolean, writeByte, writeByte, writeChar, writeChar, writeDouble, writeDouble, writeFloat, writeFloat, writeInt, writeInt, writeLong, writeLong, writeMedium, writeMedium, writeShort, writeShort, writeString, writeString, writeString, writeString, writeUnsignedByte, writeUnsignedByte, writeUnsignedInt, writeUnsignedInt, writeUnsignedMedium, writeUnsignedMedium, writeUnsignedShort, writeUnsignedShort, writeUTF8, writeUTF8, zero, zero, zeroequals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitreadByteswriteBytespublic Buffer root()
public boolean isDirect()
BufferisDirect in interface BufferisDirect in class AbstractBufferpublic boolean isFile()
BufferisFile in interface BufferisFile in class AbstractBufferpublic boolean isReadOnly()
BufferisReadOnly in interface BufferisReadOnly in class AbstractBufferpublic Buffer compact()
Buffercompact in interface Buffercompact in class AbstractBufferpublic Buffer duplicate()
Bufferpublic Buffer acquire()
acquire in interface io.atomix.utils.concurrent.ReferenceCounted<Buffer>acquire in class AbstractBufferpublic boolean release()
release in interface io.atomix.utils.concurrent.ReferenceCounted<Buffer>release in class AbstractBufferpublic void close()
Buffer
This method effectively acts as an alias to ReferenceCounted.release() and allows buffers to
be used as resources in try-with-resources statements. When the buffer is closed the internal reference counter
defined by ReferenceCounted will be decremented. However, if references to the
buffer still exist then those references will be allowed to continue to operate on the buffer until all references
have been released.
close in interface Bufferclose in interface BufferInput<Buffer>close in interface BufferOutput<Buffer>close in interface io.atomix.utils.concurrent.ReferenceCounted<Buffer>close in interface AutoCloseableclose in class AbstractBufferCopyright © 2013–2017. All rights reserved.