| OLD | NEW |
| 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file | 1 // Copyright (c) 2014, the Dart project authors. Please see the AUTHORS file |
| 2 // for details. All rights reserved. Use of this source code is governed by a | 2 // for details. All rights reserved. Use of this source code is governed by a |
| 3 // BSD-style license that can be found in the LICENSE file. | 3 // BSD-style license that can be found in the LICENSE file. |
| 4 | 4 |
| 5 library index.split.store; | 5 library index.split.store; |
| 6 | 6 |
| 7 import 'dart:async'; | 7 import 'dart:async'; |
| 8 import 'dart:collection'; | 8 import 'dart:collection'; |
| 9 import 'dart:io'; | 9 import 'dart:io'; |
| 10 import 'dart:typed_data'; | 10 import 'dart:typed_data'; |
| (...skipping 22 matching lines...) Expand all Loading... |
| 33 void delete(String name); | 33 void delete(String name); |
| 34 | 34 |
| 35 /** | 35 /** |
| 36 * Read the entire file contents as a list of bytes. | 36 * Read the entire file contents as a list of bytes. |
| 37 */ | 37 */ |
| 38 Future<List<int>> read(String name); | 38 Future<List<int>> read(String name); |
| 39 | 39 |
| 40 /** | 40 /** |
| 41 * Write a list of bytes to a file. | 41 * Write a list of bytes to a file. |
| 42 */ | 42 */ |
| 43 Future write(String name, Uint8List bytes); | 43 Future write(String name, List<int> bytes); |
| 44 } | 44 } |
| 45 | 45 |
| 46 | 46 |
| 47 /** | 47 /** |
| 48 * A [FileManager] based [NodeManager]. | 48 * A [FileManager] based [NodeManager]. |
| 49 */ | 49 */ |
| 50 class FileNodeManager implements NodeManager { | 50 class FileNodeManager implements NodeManager { |
| 51 static int _VERSION = 1; | 51 static int _VERSION = 1; |
| 52 | 52 |
| 53 final ContextCodec contextCodec; | 53 final ContextCodec contextCodec; |
| (...skipping 825 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 879 return new Uint8List.fromList(_buffer.takeBytes()); | 879 return new Uint8List.fromList(_buffer.takeBytes()); |
| 880 } | 880 } |
| 881 | 881 |
| 882 void writeInt(int value) { | 882 void writeInt(int value) { |
| 883 _buffer.addByte((value & 0xFF000000) >> 24); | 883 _buffer.addByte((value & 0xFF000000) >> 24); |
| 884 _buffer.addByte((value & 0x00FF0000) >> 16); | 884 _buffer.addByte((value & 0x00FF0000) >> 16); |
| 885 _buffer.addByte((value & 0x0000FF00) >> 8); | 885 _buffer.addByte((value & 0x0000FF00) >> 8); |
| 886 _buffer.addByte(value & 0xFF); | 886 _buffer.addByte(value & 0xFF); |
| 887 } | 887 } |
| 888 } | 888 } |
| OLD | NEW |