diff options
author | Ed Merks | 2015-12-30 12:09:30 +0000 |
---|---|---|
committer | Ed Merks | 2015-12-30 12:09:30 +0000 |
commit | 8f5eaad65d40a9df617c6cf95d8b804579306abc (patch) | |
tree | 26f131e48aa2430fcb86ef012352a9626cf135be /plugins/org.eclipse.oomph.util/src/org | |
parent | 5344602611b40d63406194f825d20f5e5b223728 (diff) | |
download | org.eclipse.oomph-8f5eaad65d40a9df617c6cf95d8b804579306abc.tar.gz org.eclipse.oomph-8f5eaad65d40a9df617c6cf95d8b804579306abc.tar.xz org.eclipse.oomph-8f5eaad65d40a9df617c6cf95d8b804579306abc.zip |
[485011] FileNotFoundException below
CachingTransport$StatefulFileOutputStream.<init>
https://bugs.eclipse.org/bugs/show_bug.cgi?id=485011
Diffstat (limited to 'plugins/org.eclipse.oomph.util/src/org')
-rw-r--r-- | plugins/org.eclipse.oomph.util/src/org/eclipse/oomph/util/IOUtil.java | 20 |
1 files changed, 5 insertions, 15 deletions
diff --git a/plugins/org.eclipse.oomph.util/src/org/eclipse/oomph/util/IOUtil.java b/plugins/org.eclipse.oomph.util/src/org/eclipse/oomph/util/IOUtil.java index f1b873358..c3be3dc62 100644 --- a/plugins/org.eclipse.oomph.util/src/org/eclipse/oomph/util/IOUtil.java +++ b/plugins/org.eclipse.oomph.util/src/org/eclipse/oomph/util/IOUtil.java @@ -62,7 +62,7 @@ public final class IOUtil { private static final int MAX_FILE_NAME_LENGTH = 200; - private static final byte[] BUFFER = new byte[8192]; + private static final int DEFAULT_BUFFER_SIZE = 8192; private static final ObjectOutputStream DEV_NULL = createDevNull(); @@ -291,12 +291,10 @@ public final class IOUtil } }; - synchronized (BUFFER) + byte[] bytes = new byte[DEFAULT_BUFFER_SIZE]; + while (stream.read(bytes) != -1) { - while (stream.read(BUFFER) != -1) - { - // Do nothing - } + // Do nothing } return digest.digest(); @@ -604,20 +602,12 @@ public final class IOUtil public static long copy(InputStream input, OutputStream output, int bufferSize) throws IORuntimeException { - if (bufferSize == BUFFER.length) - { - return copy(input, output); - } - return copy(input, output, new byte[bufferSize]); } public static long copy(InputStream input, OutputStream output) throws IORuntimeException { - synchronized (BUFFER) - { - return copy(input, output, BUFFER); - } + return copy(input, output, DEFAULT_BUFFER_SIZE); } public static void copyTree(File source, File target, boolean bestEffort) throws IORuntimeException |