readBytes method

void readBytes(
  1. ByteArray bytes, [
  2. int offset = 0,
  3. int length = 0
])

Reads the number of data bytes, specified by the length parameter, from the byte stream.

Implementation

void readBytes(ByteArray bytes, [int offset = 0, int length = 0]) {
  if (length == 0) {
    length = bytesAvailable;
  }
  var sourceBytes = _readBytes(length);
  bytes._setAll(offset, sourceBytes);
}