Dart API Referencedart:scalarlistByteArrayViewable

ByteArrayViewable abstract class

A "mixin interface" that allows a type, typically but not necessarily a List, to be viewed as a ByteArray.

abstract class ByteArrayViewable {
  /**
   * Returns the number of bytes in the representation of each element in
   * this list, or the number bytes in the representation of the entire
   * object if it is not a list.
   */
  int bytesPerElement();

  /**
   * Returns the length of this view, in bytes.
   */
  int lengthInBytes();

  /**
   * Returns the byte array view of this object. This view allows the
   * byte representation of the object to be read and written directly.
   */
  ByteArray asByteArray([int start, int length]);
}

Subclasses

Float32List, Float64List, Int16List, Int32List, Int64List, Int8List, Uint16List, Uint32List, Uint64List, Uint8List

Methods

ByteArray asByteArray([int start, int length]) #

Returns the byte array view of this object. This view allows the byte representation of the object to be read and written directly.

ByteArray asByteArray([int start, int length]);

int bytesPerElement() #

Returns the number of bytes in the representation of each element in this list, or the number bytes in the representation of the entire object if it is not a list.

int bytesPerElement();

int lengthInBytes() #

Returns the length of this view, in bytes.

int lengthInBytes();