DartCodecBuffer class

Implementation of an in-memory Dart heap CodecBuffer

The backing buffer is a Uint8List which store the bytes. There are base, read and write DartHeapPointers required by the superclass.

This buffer is designed to be used by codec algorithms that are implemented in pure Dart code, and do not need ffi dependencies.

Inheritance

Constructors

DartCodecBuffer(int length)
Constructs a DartCodecBuffer that is backed by a Uint8List with the provided length.

Properties

basePtr DartHeapPointer
Wrapped pointer to the first element in the list
latefinal
hashCode int
The hash code for this object.
no setterinherited
length int
Length of the internal buffer in bytes.
finalinherited
readCount int
Return total number of readCount within the buffer.
getter/setter pairinherited
readPtr DartHeapPointer
Updates the read offset of the wrapped pointer and returns it.
no setteroverride
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
totalReadCount int
Return the total number of readCount since the last hard reset.
no setterinherited
totalWriteCount int
Return the total number of writeCount since the last hard reset.
no setterinherited
unreadCount int
Return total number of remaining bytes available to be read
no setterinherited
unwrittenCount int
Return the number of bytes the buffer still has available for writing.
no setterinherited
writeCount int
Return the number of bytes currently written to the buffer.
getter/setter pairinherited
writePtr DartHeapPointer
Updates the write offset of the wrapped pointer and returns it.
no setteroverride

Methods

atEnd() bool
Return true if all writeCount have been read, false otherwise.
inherited
atEndAndIsFull() bool
Return true if all writeCount have been read and there are no remaining unwrittenCount, false otherwise.
inherited
baseListView(int length) Uint8List
Return a subview list from 0..length
override
basicNext() int
Read the next byte, increment the readCount, return the byte read.
override
basicNextPut(int byte) int
Put the next byte into the buffer.
override
basicPeek() int
Peek the next byte from the list.
override
incrementBytesRead(int amount) → void
Update the read position by amount bytes.
inherited
incrementBytesWritten(int amount) → void
Update the write position by amount bytes.
inherited
isAvailable() bool
Always true
override
isFull() bool
Return true if there are no unwrittenCount remaining, false otherwise.
inherited
next({int onEnd()?}) int
Read and return the next byte. The readCount will be incremented by 1.
inherited
nextAll(int amount, {bool upToAmount = false}) List<int>
Consume and answer a List containing up to the next amount of consecutive bytes.
inherited
nextPut(int byte, {void onEnd()?}) bool
Put the next byte into the buffer.
inherited
nextPutAll(List<int> bytes, [int? start, int? end]) int
Put bytes into the buffer.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
peek({int onEnd()?}) int
Read the next byte without consuming it.
inherited
readBytes({bool copy = true, bool reset = false, bool hard = false}) List<int>
Return the read contents of the buffer as a List.
inherited
readListView(int length) Uint8List
Return a subview list from readCount..length
override
release() → void
No action required.
override
reset({bool hard = false}) → void
Reset the read/write offsets in the buffer.
inherited
resetRead({bool hard = false}) → void
Reset the read offsets in the buffer.
inherited
resetWrite({bool hard = false}) → void
Reset the write offsets in the buffer.
inherited
toString() String
A string representation of this object.
inherited
writeListView(int length) Uint8List
Return a subview list from writeCount..length
override
writtenBytes({bool copy = true, bool reset = false, bool hard = false}) List<int>
Return the written contents of the buffer as a List.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited