toBuffer method Null safety

Uint8List toBuffer()

Implementation

Uint8List toBuffer() {
  var result = Uint8List(_bytesTotal);
  writeTo(result);
  return result;
}