blob: 99140eebc8a046e1be6ae8db212aa3d0c1f663c8 [file] [log] [blame]
// Copyright (c) 2019, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
import 'dart:io';
/**
* A string sink that write into a file.
*/
class FileStringSink implements StringSink {
IOSink _sink;
FileStringSink(String path) {
_sink = File(path).openWrite(mode: FileMode.append);
}
void write(Object obj) {
throw UnimplementedError();
}
void writeAll(Iterable objects, [String separator = ""]) {
throw UnimplementedError();
}
void writeCharCode(int charCode) {
throw UnimplementedError();
}
void writeln([Object obj = ""]) {
var currentTimeMillis = DateTime.now().millisecondsSinceEpoch;
_sink.writeln('$currentTimeMillis $obj');
}
}