jovial_misc 0.8.5 copy "jovial_misc: ^0.8.5" to clipboard
jovial_misc: ^0.8.5 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
pub points
70%
popularity

Publisher

verified publisherjovial.com

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, pointycastle

More

Packages that depend on jovial_misc