MemPtr class

A helper class to work with List and TypedData in a way similar to pointers in C.

Constructors

MemPtr(List<int> other, [int offset = 0, int _length = -1, int byteOrder = LITTLE_ENDIAN])
MemPtr.from(MemPtr other, [int offset = 0, int _length = -1])

Properties

buffer List<int>
read / write
byteOrder int
read / write
isEOS bool
Are we at the end of the buffer?
read-only
length int
The number of bytes remaining in the buffer.
read-only
offset int
read / write
hashCode int
The hash code for this object. [...]
read-only, inherited
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

memcpy(int start, int length, dynamic other, [int offset = 0]) → void
Copy data from other to this buffer, at start offset from the current read position, and length number of bytes. offset is the offset in other to start reading.
memset(int start, int length, int value) → void
Set a range of bytes in this buffer to value, at start offset from the current read position, and length number of bytes.
readByte() int
Read a single byte.
readBytes(int count) List<int>
Read count bytes from the buffer.
readString([int len]) String
Read a null-terminated string, or if len is provided, that number of bytes returned as a string.
readUint16() int
Read a 16-bit word from the stream.
readUint24() int
Read a 24-bit word from the stream.
readUint32() int
Read a 32-bit word from the stream.
toUint8List([int offset = 0]) Uint8List
This assumes buffer is a Typed
toUint32List([int offset = 0]) Uint32List
This assumes buffer is a Typed
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent method or property is accessed. [...]
inherited
toString() String
Returns a string representation of this object.
inherited

Operators

operator [](int index) int
Get a byte in the buffer relative to the current read position.
operator []=(int index, int value) → void
Set a byte in the buffer relative to the current read position.
operator ==(dynamic other) bool
The equality operator. [...]
inherited