FixedWriteBuffer class
This provides methods to read and write strings, lists and various sized integers on a buffer (implemented as an integer list).
The ints in the backing list must all be 8-bit values. If larger values are entered, behaviour is undefined.
As per mysql spec, numbers here are all unsigned. Which makes things much easier.
Constructors
- FixedWriteBuffer(int size)
-
Creates a Buffer of the given
size
-
FixedWriteBuffer.fromList(List<
int> list) -
Creates a Buffer with the given
list
as backing storage
Properties
- byte ← int
-
Writes a single byte to the buffer.
no getter
- canWriteMore → bool
-
no setter
- data → Uint8List
-
final
- double_ ← double
-
no getter
- float ← double
-
no getter
- hashCode → int
-
The hash code for this object.
no setterinherited
- int16 ← int
-
Writes a 16 bit
integer
to the buffer.no getter - int32 ← int
-
Writes a 32 bit
integer
to the buffer.no getter - int64 ← int
-
Writes a 64 bit
integer
to the buffer.no getter - length → int
-
Returns the size of the buffer
no setter
-
nullTerminatedList
← List<
int> -
Writes a null terminated list of ints from the buffer. The given
list
should not contain the terminating zero.no getter - runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- uint16 ← int
-
Writes a 16 bit
integer
to the buffer.no getter - uint24 ← int
-
Writes a 24 bit
integer
to the buffer.no getter - uint32 ← int
-
Writes a 32 bit
integer
to the buffer.no getter - uint64 ← int
-
Writes a 64 bit
integer
to the buffer.no getter
Methods
-
fill(
int numberOfBytes, int value) → void -
Fills the next
numberOfBytes
with the givenvalue
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
reset(
) → void -
resetWrite(
) → void - Resets the read and write positions markers to the start of the buffer.
-
seekWrite(
int position) → void -
Moves the write marker to the given
position
-
skipWrite(
int numberOfBytes) → void -
Moves the write marker forwards by the given
numberOfBytes
-
toString(
) → String -
A string representation of this object.
inherited
-
writeLengthCodedBinary(
int value) → void - Will write a length coded binary value, once implemented!
-
writeList(
List< int> list) → void -
Writes the give
list
of bytes to the buffer.
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
-
operator []=(
int index, dynamic value) → void -
Sets the int at the specified
index
to the givenvalue