toByteArray static method
Convenience class to serialize to a bytearray. @param obj the object to serialize @return byteArray representing the object
Implementation
static Future<List<int>> toByteArray(Serializer obj) async {
ByteSink out = ByteSink();
obj.toByteArrayStream(out);
out.close();
return out.bytes;
}