diff --git a/platform/core-impl/src/com/intellij/openapi/vfs/impl/ZipHandler.java b/platform/core-impl/src/com/intellij/openapi/vfs/impl/ZipHandler.java index cdbc80ff1310..f9da23906dad 100644 --- a/platform/core-impl/src/com/intellij/openapi/vfs/impl/ZipHandler.java +++ b/platform/core-impl/src/com/intellij/openapi/vfs/impl/ZipHandler.java @@ -25,6 +25,7 @@ import com.intellij.util.text.ByteArrayCharSequence; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; +import java.io.BufferedInputStream; import java.io.Closeable; import java.io.File; import java.io.IOException; @@ -194,6 +195,7 @@ public class ZipHandler extends ArchiveHandler { if (entry != null) { InputStream stream = zip.getInputStream(entry); if (stream != null) { + stream = new BufferedInputStream(stream); try { return FileUtil.loadBytes(stream, (int)entry.getSize()); } diff --git a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/LocalFileSystemBase.java b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/LocalFileSystemBase.java index 2fcd802d4227..a68454ba2064 100644 --- a/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/LocalFileSystemBase.java +++ b/platform/platform-impl/src/com/intellij/openapi/vfs/impl/local/LocalFileSystemBase.java @@ -476,7 +476,7 @@ public abstract class LocalFileSystemBase extends LocalFileSystem { @Override @NotNull public byte[] contentsToByteArray(@NotNull final VirtualFile file) throws IOException { - final FileInputStream stream = new FileInputStream(convertToIOFileAndCheck(file)); + final InputStream stream = new BufferedInputStream(new FileInputStream(convertToIOFileAndCheck(file))); try { long l = file.getLength(); if (l > Integer.MAX_VALUE) throw new IOException("File is too large: " + l + ", " + file);