RawReader class
Constructors
- RawReader.withByteData(ByteData _byteData, {int index = 0, bool isCopyOnRead = true})
-
RawReader.withBytes(List<
int> bytes, {bool isCopyOnRead = true}) -
factory
Properties
- availableLengthInBytes → int
-
Returns the number of bytes remaining.
no setter
- bufferAsByteData → ByteData
-
Returns the buffer as ByteData.
no setter
- bufferAsUint8List → Uint8List
-
Returns the buffer as Uint8List.
no setter
- hashCode → int
-
The hash code for this object.
no setterinherited
- index ↔ int
-
Current index in the buffer.
getter/setter pair
- isCopyOnRead → bool
-
Whether returned typed data slices should be copies.
final
- isEndOfBytes → bool
-
Returns true if there are no more bytes available.
no setter
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
lengthUntilZero(
{int? maxLength}) → int - Returns the number of bytes before the next zero byte.
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
previewUint16(
int index, [Endian endian = Endian.big]) → int - Previews a future uint16 without advancing in the byte list.
-
previewUint32(
int index, [Endian endian = Endian.big]) → int - Previews a future uint32 without advancing in the byte list.
-
previewUint8(
int index) → int - Previews a future uint8 without advancing in the byte list.
-
readByteDataCopy(
int length) → ByteData -
Returns the next
lengthbytes. The method always returns a new copy of the bytes. -
readByteDataViewOrCopy(
int? length) → ByteData -
Returns the next
lengthbytes. -
readFixInt64(
[Endian endian = Endian.big]) → Int64 - Reads a 64-bit signed integer as Int64 (from 'package:fixnum'). Increments index by 8.
-
readFloat32(
[Endian endian = Endian.big]) → double - Reads a 32-bit floating-point value. Increments index by 4.
-
readFloat64(
[Endian endian = Endian.big]) → double - Reads a 64-bit floating-point value. Increments index by 8.
-
readInt16(
[Endian endian = Endian.big]) → int - Reads a 32-bit signed integer. Increments index by 2.
-
readInt32(
[Endian endian = Endian.big]) → int - Reads a 32-it signed integer. Increments index by 4.
-
readInt8(
) → int - Reads an 8-bit signed integer. Increments index by 1.
-
readRawReader(
int length) → RawReader - Returns a new RawReader that is backed by a span of this RawReader.
-
readUint16(
[Endian endian = Endian.big]) → int - Reads a 16-bit unsigned integer. Increments index by 2.
-
readUint32(
[Endian endian = Endian.big]) → int - Reads a 32-bit unsigned integer. Increments index by 4.
-
readUint8(
) → int - Reads an 8-bit unsigned integer. Increments index by 1.
-
readUint8ListCopy(
[int? length]) → Uint8List - Returns the next bytes. Length is determined by the argument. The method always returns a new copy of the bytes.
-
readUint8ListViewOrCopy(
int? length) → Uint8List - Returns the next bytes. Length is determined by the argument.
-
readUtf8(
int length) → String - Reads an UTF-8 string.
-
readUtf8NullEnding(
) → String - Reads a null-terminated UTF-8 string.
-
readUtf8Simple(
int length) → String - Reads an UTF-8 string. Throws RawReaderException if a multi-byte rune is encountered.
-
readUtf8SimpleNullEnding(
int length) → String - Reads an UTF-8 string delimited by a zero-byte. Throws RawReaderException if a multi-byte rune is encountered.
-
readVarInt(
) → int - Reads a variable-length signed integer. Compatible with Protocol Buffers encoding.
-
readVarUint(
) → int - Reads a variable-length unsigned integer. Compatible with Protocol Buffers encoding.
-
readZeroes(
int length) → void - Reads N bytes and verifies that every one is zero.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited