writtenBytes method
Return the written contents of the buffer as a List.
This will include the data in the buffer from the start up to the
written amount.
If copy
is true, then a copy of the bytes will be returned, otherwise
a view of the bytes is returned (which may change since this is buffered)
If reset
is true, the writeCount will be set to 0.
If hard
is true, the _recordedWriteCount
will also be set to 0.
Implementation
List<int> writtenBytes(
{bool copy = true, bool reset = false, bool hard = false}) {
final listView = baseListView(writeCount);
final list = (copy == true) ? Uint8List.fromList(listView) : listView;
if (reset == true) resetWrite(hard: hard);
return list;
}