Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(339)

Unified Diff: pkg/analyzer/lib/file_system/file_system.dart

Issue 1811643002: Add File.readAsBytesSync/writeAsBytesSync() methods. (Closed) Base URL: git@github.com:dart-lang/sdk.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | pkg/analyzer/lib/file_system/memory_file_system.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: pkg/analyzer/lib/file_system/file_system.dart
diff --git a/pkg/analyzer/lib/file_system/file_system.dart b/pkg/analyzer/lib/file_system/file_system.dart
index c9b3e96baf54391362ead2d3ed97ffc7bd84d2d2..093f47f04f84f62a8b96bc340ba75cadea3e0d71 100644
--- a/pkg/analyzer/lib/file_system/file_system.dart
+++ b/pkg/analyzer/lib/file_system/file_system.dart
@@ -32,10 +32,23 @@ abstract class File implements Resource {
Source createSource([Uri uri]);
/**
+ * Synchronously read the entire file contents as a list of bytes.
+ * Throws a [FileSystemException] if the operation fails.
+ */
+ List<int> readAsBytesSync();
+
+ /**
* Synchronously read the entire file contents as a [String].
* Throws [FileSystemException] if the file does not exist.
*/
String readAsStringSync();
+
+ /**
+ * Synchronously write a list of bytes to the file.
+ *
+ * Throws a [FileSystemException] if the operation fails.
+ */
+ void writeAsBytesSync(List<int> bytes);
}
/**
@@ -63,7 +76,7 @@ abstract class Folder implements Resource {
/**
* If the path [path] is a relative path, convert it to an absolute path
- * by interpreting it relative to this folder. If it is already an aboslute
+ * by interpreting it relative to this folder. If it is already an absolute
* path, then don't change it.
*
* However, regardless of whether [path] is relative or absolute, normalize
« no previous file with comments | « no previous file | pkg/analyzer/lib/file_system/memory_file_system.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698