| Index: sdk/lib/io/file_impl.dart
|
| diff --git a/sdk/lib/io/file_impl.dart b/sdk/lib/io/file_impl.dart
|
| index 3ae67e3e91d1bb31f7a216cb6842892df5d3da96..1a69a0d4a9807178ccdcc947523cadb0b9f4ee14 100644
|
| --- a/sdk/lib/io/file_impl.dart
|
| +++ b/sdk/lib/io/file_impl.dart
|
| @@ -643,8 +643,25 @@ abstract class _RandomAccessFileOps {
|
| length();
|
| flush();
|
| lock(int lock, int start, int end);
|
| + setTranslation(int translation);
|
| }
|
|
|
| +
|
| +/**
|
| + * The translation mode of a File.
|
| + *
|
| + * Whether the data written to a file should be interpreted as text
|
| + * or binary data. This distinction is only meaningful on platforms that
|
| + * recognize a difference, in particular on Windows.
|
| + */
|
| +enum _FileTranslation {
|
| + /// Data should be interpreted as text.
|
| + text,
|
| + /// Data should be interpreted as binary data.
|
| + binary,
|
| +}
|
| +
|
| +
|
| class _RandomAccessFile implements RandomAccessFile {
|
| static bool _connectedResourceHandler = false;
|
|
|
| @@ -656,9 +673,12 @@ class _RandomAccessFile implements RandomAccessFile {
|
| _FileResourceInfo _resourceInfo;
|
| _RandomAccessFileOps _ops;
|
|
|
| + _FileTranslation _translation;
|
| +
|
| _RandomAccessFile(int pointer, this.path) {
|
| _ops = new _RandomAccessFileOps(pointer);
|
| _resourceInfo = new _FileResourceInfo(this);
|
| + _translation = _FileTranslation.binary;
|
| _maybeConnectHandler();
|
| }
|
|
|
| @@ -1059,6 +1079,15 @@ class _RandomAccessFile implements RandomAccessFile {
|
| }
|
| }
|
|
|
| + _FileTranslation get translation => _translation;
|
| +
|
| + void set translation(_FileTranslation translation) {
|
| + if (_translation != translation) {
|
| + _ops.setTranslation(translation.index);
|
| + _translation = translation;
|
| + }
|
| + }
|
| +
|
| bool closed = false;
|
|
|
| // Calling this function will increase the reference count on the native
|
|
|