jovial_misc 0.9.0 copy "jovial_misc: ^0.9.0" to clipboard
jovial_misc: ^0.9.0 copied to clipboard

Miscellaneous Dart libraries, including interoperability with java.io.DataInputStream and java.io.DataOutputStream.

example/example.dart

import 'dart:async';
import 'dart:io';
import 'package:jovial_misc/io_utils.dart';

///
/// Example of using [DataOutputSink] and [DataInputStream] to
/// encode values that are compatible with `java.io.DataInputStream`
/// and `java.io.DataOutputStream`
///
Future<void> dataIoStreamExample() async {
  final file = File.fromUri(Directory.systemTemp.uri.resolve('test.dat'));
  final sink = file.openWrite();
  final out = DataOutputSink(sink);
  out.writeUTF8('Hello, world.');
  await sink.close();

  final dis = DataInputStream(file.openRead());
  print(await dis.readUTF8());
  await dis.close();
  await file.delete();
}

///
/// Run the example
///
void main() async {
  await dataIoStreamExample();
}
3
likes
160
points
166k
downloads

Publisher

verified publisherjovial.com

Weekly Downloads

Miscellaneous Dart libraries, including interoperability with java.io.DataInputStream and java.io.DataOutputStream.

Homepage
Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

async, collection, convert, meta

More

Packages that depend on jovial_misc