toByteDataView method

ByteData toByteDataView()

Returns a view at the written bytes. The length will be equal to length.

Implementation

ByteData toByteDataView() {
  final byteData = this._byteData;
  final length = this._length;
  if (length == byteData.lengthInBytes) {
    return byteData;
  }
  return new ByteData.view(
    byteData.buffer,
    byteData.offsetInBytes,
    length,
  );
}