API Reference 1.0.1+1rikulo_convert

rikulo_convert library

Functions

Future<dynamic> readAsJson(Stream<List<int>> stream, {Encoding encoding: UTF8}) #

Reads the entire stream as a JSON string using the given Encoding, and then convert to an object.

Future<dynamic> readAsJson(Stream<List<int>> stream,
   {Encoding encoding: UTF8})
=> readAsString(stream, encoding: encoding).then((String data) => JSON.decode(data));

Future<String> readAsString(Stream<List<int>> stream, {Encoding encoding: UTF8}) #

Reads the entire stream as a string using the given Encoding.

Future<String> readAsString(Stream<List<int>> stream, 
   {Encoding encoding: UTF8}) {
 final List<int> result = [];
 return stream.listen((data) {
   result.addAll(data);
 }).asFuture().then((_) {
   return encoding.decode(result);
 });
}