diff --git a/classlib/src/main/java/org/teavm/classlib/fs/memory/InMemoryVirtualFile.java b/classlib/src/main/java/org/teavm/classlib/fs/memory/InMemoryVirtualFile.java index a398d8d58..0f9dc31f8 100644 --- a/classlib/src/main/java/org/teavm/classlib/fs/memory/InMemoryVirtualFile.java +++ b/classlib/src/main/java/org/teavm/classlib/fs/memory/InMemoryVirtualFile.java @@ -53,6 +53,10 @@ public class InMemoryVirtualFile extends AbstractInMemoryVirtualFile { return null; } + if (writable && readOnly) { + return null; + } + return new VirtualFileAccessor() { @Override public int read(int pos, byte[] buffer, int offset, int limit) {