toByteArray method

Future<List<int>> toByteArray()

Wrapper function to simplify serialization. @return the serializer object as byte array

Implementation

Future<List<int>> toByteArray() async {
  ByteSink out = ByteSink();
  toByteArrayStream(out);
  out.close();
  return out.bytes;
}