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 = null, Endian endian = Endian.little])
factory
ByteArray.fromByteData(ByteData _byteData, [Endian endian = Endian.little])

Properties

buffer ByteBuffer
read-only
bytesAvailable int
read-only
endian Endian
read / write
hashCode int
The hash code for this object. [...]
read-only, override
length int
read-only
offset int
read / write
runtimeType Type
A representation of the runtime type of the object.
read-only, inherited

Methods

byteStream() Iterable<int>
noSuchMethod(Invocation invocation) → dynamic
Invoked when a non-existent 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
Returns 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 to this
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 to this
operator ==(Object otherObject) 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