toByteDataCopy method

ByteData toByteDataCopy()

Returns a copy of the written bytes. The length will be equal to length.

Implementation

ByteData toByteDataCopy() {
  final length = this._length;
  final result = new ByteData(length);
  final writer = new RawWriter.withByteData(result);
  writer.writeByteData(_byteData, 0, length);
  return result;
}