BytesReader class
Utility class to incrementally read through a series of bytes, interpreting byte combinations as little endian ints and floats etc. Every read operation moves the read head forward by the corresponding number of bytes.
Constructors
- BytesReader(Uint8List _bytes)
- Constructs a BytesReader.
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
assertString(
String s) → void -
Reads a string of the same length as
s, then checks that the read string matchess. Throws a FormatException if they don't match.smust be ASCII only. -
findChunk(
String identifier) → void -
Reads RIFF chunks until one is found that has the given
identifier. When this function returns, the read head will either be just after theidentifier(about to read the size), or at the end of the buffer. -
getSampleReader(
WavFormat format) → SampleReader -
Returns a closure that reads samples of the given
formatfrom this buffer. Calling these closures advances the read head of this buffer. -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readUint16(
) → int - Reads a Uint16 from the buffer.
-
readUint24(
) → int - Reads a Uint24 from the buffer.
-
readUint32(
) → int - Reads a Uint32 from the buffer.
-
readUint8(
) → int - Reads a Uint8 from the buffer.
-
skip(
int n) → void -
Skip forward
nbytes. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited