RandomAccessFileByteBuf class
A ByteBuf that stores its data in a RandomAccessFile.
- Inheritance
- Available Extensions
- Annotations
-
- @experimental
Constructors
Properties
-
activeViews
↔ List<
MapEntry< int, Uint8List> > -
getter/setter pair
- file ↔ RandomAccessFile
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- isReadable → bool
-
Returns true if there are any readable bytes left.
no setterinherited
- isWritable → bool
-
Returns true if there are writeable bytes left.
no setterinherited
-
listView
→ List<
int> -
no setterinherited
- maxCapacity ↔ int
-
Upper constraint of the buffer capacity.
getter/setter pairinherited
- minCapacity ↔ int
-
Lower constraint of the buffer capacity.
getter/setter pairinherited
- readableBytes → int
-
Amount of bytes which are readable from the current
readerIndex (inclusive).
no setterinherited
- readerIndex ↔ int
-
Current reader index.
getter/setter pairinherited
- readMarker ↔ int
-
The marker of the readerIndex. Overrides the readerIndex
with its value when resetReaderIndex is called.
getter/setter pairinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- writableBytes → int
-
Amount of free bytes inside the buffer from the
current writerIndex (inclusive).
no setterinherited
- writeMarker ↔ int
-
The marker of the writerIndex. Overrides the writerIndex
with its value when resetWriterIndex is called.
getter/setter pairinherited
- writerIndex ↔ int
-
Current writer index.
getter/setter pairinherited
Methods
-
allocate(
int bytes) → void -
Allocates/Grows the buffer by
bytes
inside its own constraints.override -
array(
) → Uint8List -
Copies the whole buffer to a separate Uint8List.
override
-
assertReadable(
int index, int length) → void -
Asserts the writability of the region.
inherited
-
assertWriteable(
int index, int length) → void -
Asserts the readability of the region.
inherited
-
capacity(
) → int -
Current capacity of the buffer
override
-
checkReadable(
int index, int length) → bool -
Checks the readability of the region while not taking buffer growth
into account. Doesn't throw exceptions.
inherited
-
checkWriteable(
int index, int length) → bool -
Checks the writability of the region while not taking buffer growth
into account. Doesn't throw exceptions.
inherited
-
clear(
) → void -
Sets both readerIndex and writerIndex to 0.
inherited
-
close(
) → void -
createReadMarker(
) → LinkedReadMarker -
Creates a read marker which doesn't depend on the buffers own markers.
inherited
-
createWriteMarker(
) → LinkedWriteMarker -
Creates a write marker which doesn't depend on the buffers own markers.
inherited
-
discardReadBytes(
) → int -
Discards all already read bytes and shifts all contents to the left,
so that readerIndex is 0 again. The writerIndex gets decreased by
the amount of bytes freed.
inherited
-
ensureWritable(
int minWritableBytes) → int -
Tries to expand the buffer to fit at least
minWritableBytes
and returns the amount of bytes which were allocated.inherited -
flush(
) → void -
getBuffer(
int index, int length) → ByteBuf -
Returns a ByteBuf viewing a region beginning at
index
with the length oflength
.inherited -
getByte(
int index) → int -
Gets the byte at
index
.override -
getByteData(
int index, int length) → ByteData -
Reads
length
bytes beginning atindex
(inclusive) as a native ByteData view.override -
getBytes(
int index, int length) → Uint8List -
Reads
length
bytes beginning atindex
(inclusive) into a Uint8List.override -
isGrowable(
) → bool -
Defines if the buffer can expand its capacity
insides its own constraints.
override
-
markReaderIndex(
) → void -
Sets the readMarker to readerIndex.
inherited
-
markWriterIndex(
) → void -
Sets the writeMarker to writerIndex.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
peekAvailableBytes(
) → Uint8List -
Reads all available bytes into a Uint8List without incrementing
the reader index.
inherited
-
readAvailableBytes(
) → Uint8List -
Reads all available bytes into a Uint8List.
inherited
-
readBuffer(
int length) → ByteBuf -
Returns a ByteBuf viewing a region beginning at readerIndex
with the length of
length
.inherited -
readByte(
) → int -
Reads the byte at the readerIndex and increments
the readerIndex by 1 afterwards.
inherited
-
readByteData(
int length) → ByteData -
Reads
length
bytes beginning at readerIndex (inclusive) as a native ByteData view and increments readerIndex bylength
afterwards.override -
readBytes(
int length) → Uint8List -
Reads the next
length
bytes at the current readerIndex (inclusive) and increments the readerIndex bylength
.override -
resetReaderIndex(
) → void -
Resets the readerIndex to readMarker.
inherited
-
resetWriterIndex(
) → void -
Resets the writerIndex to writeMarker.
inherited
-
setBuffer(
int index, ByteBuf buffer) → void -
Writes the content of
buffer
atindex
(inclusive).inherited -
setByte(
int index, int byte) → void -
Sets the byte at
index
tobyte
.inherited -
setByteData(
int index, int length) → ByteData -
Returns a writeable native ByteData view of the
buffer
atindex
(inclusive) with an length oflength
.override -
setBytes(
int index, List< int> bytes) → void -
Writes the content of
bytes
atindex
(inclusive).override -
toString(
) → String -
A string representation of this object.
inherited
-
updateByte(
int index, int byte) → void -
Sets the byte at
index
tobyte
.override -
viewBuffer(
int index, int length) → ByteBuf -
Returns a ByteBuf viewing a region beginning at
index
with the length oflength
.override -
viewByteData(
int index, int length) → ByteData -
Creates a native ByteData view at
index
with the length oflength
.override -
writeActiveBuffers(
) → void -
writeBuffer(
ByteBuf buffer) → void -
Writes the content of
buffer
at the current writerIndex (inclusive) and increments the writerIndex by the length of thebuffer
.inherited -
writeByte(
int byte) → void -
Write one byte with the value of
byte
at the writerIndex and increments the writerIndex by 1 afterwards.inherited -
writeByteData(
int length) → ByteData -
Returns a
length
-long native ByteData view beginning at readerIndex (inclusive) and increments the writerIndex bylength
.override -
writeBytes(
List< int> bytes) → void -
Writes the
bytes
at the current writerIndex (inclusive) and increments the writerIndex by the length of the added bytes.override -
writeTransactionBuffer(
int length) → ByteBuf -
Gets a
length
-long writable transaction buffer at the current writerIndex (inclusive) and increments the writerIndex bylength
.inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator [](
int index) → int -
Gets the byte at
index
.inherited -
operator []=(
int index, int value) → void -
Sets the byte at
index
tovalue
.inherited