encode static method

Stream<List<int>> encode(
  1. Object? value
)

Converts a single value to a json stream.

Implementation

static Stream<List<int>> encode(Object? value) {
  final writer = JsonStreamWriter();
  writer.write(value).then((_) => writer.close());
  return writer.stream;
}