ByteArray class
Read and write to an array of bytes
Constructors
- ByteArray([int length = 0, Endian endian = Endian.little])
- ByteArray.fromBuffer(ByteBuffer buffer, [int offset = 0, int? length, Endian endian = Endian.little])
-
factory
- ByteArray.fromByteData(ByteData _byteData, [Endian endian = Endian.little])
Properties
- buffer → ByteBuffer
-
no setter
- bytesAvailable → int
-
no setter
- endian ↔ Endian
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setteroverride
- length → int
-
no setter
- offset ↔ int
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
byteStream(
) → Iterable< int> -
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
readBoolean(
) → bool - Returns true if not equal to zero
-
readByte(
) → int -
readDouble(
) → double -
readFloat(
) → double -
readInt(
) → int -
readLong(
) → int -
readShort(
) → int -
readUnsignedByte(
) → int -
readUnsignedInt(
) → int -
readUnsignedLong(
) → int -
readUnsignedShort(
) → int -
toString(
) → String -
A string representation of this object.
inherited
-
writeBoolean(
bool value) → void - Writes int, 1 if true, zero if false
-
writeByte(
int value) → void -
writeBytes(
ByteArray bytes, [int offset = 0, int byteCount = 0]) → void -
Copies bytes from
bytes
tothis
-
writeDouble(
double value) → void -
writeFloat(
double value) → void -
writeInt(
int value) → void -
writeLong(
int value) → void -
writeShort(
int value) → void -
writeUnsignedByte(
int value) → void -
writeUnsignedInt(
int value) → void -
writeUnsignedLong(
int value) → void -
writeUnsignedShort(
int value) → void
Operators
-
operator +(
ByteArray other) → ByteArray -
Appends
other
tothis
-
operator ==(
Object other) → bool -
Returns true if every byte in both ByteArrays are equal
Note: offsets will not be affected
override
-
operator [](
int i) → int - Get byte at given index
-
operator []=(
int i, int value) → void - Set byte at given index