Index: pkg/analyzer/lib/file_system/memory_file_system.dart |
diff --git a/pkg/analyzer/lib/file_system/memory_file_system.dart b/pkg/analyzer/lib/file_system/memory_file_system.dart |
index 44f8a062661923f70ce486d50f28fc451d42d679..42731be1b09940893addb31a4f68e197b71bcd2d 100644 |
--- a/pkg/analyzer/lib/file_system/memory_file_system.dart |
+++ b/pkg/analyzer/lib/file_system/memory_file_system.dart |
@@ -306,6 +306,11 @@ class _MemoryDummyLink extends _MemoryResource implements File { |
bool get exists => false; |
@override |
+ int get lengthSync { |
+ throw new FileSystemException(path, 'File could not be read'); |
+ } |
+ |
+ @override |
int get modificationStamp { |
int stamp = _provider._pathToTimestamp[path]; |
if (stamp == null) { |
@@ -371,6 +376,11 @@ class _MemoryFile extends _MemoryResource implements File { |
bool get exists => _provider._pathToResource[path] is _MemoryFile; |
@override |
+ int get lengthSync { |
+ return readAsBytesSync().length; |
+ } |
+ |
+ @override |
int get modificationStamp { |
int stamp = _provider._pathToTimestamp[path]; |
if (stamp == null) { |