diff options
author | Lex Spoon <lex@lexspoon.org> | 2006-06-30 15:52:03 +0000 |
---|---|---|
committer | Lex Spoon <lex@lexspoon.org> | 2006-06-30 15:52:03 +0000 |
commit | 599eb475e4837dd4d0e1688a1a305f8cc0d589e7 (patch) | |
tree | a382707a79580063da089768e1934e914d25bad0 | |
parent | f467096ce4f9c0c02709a20adfcafa248ec5867f (diff) | |
download | scala-599eb475e4837dd4d0e1688a1a305f8cc0d589e7.tar.gz scala-599eb475e4837dd4d0e1688a1a305f8cc0d589e7.tar.bz2 scala-599eb475e4837dd4d0e1688a1a305f8cc0d589e7.zip |
when zipping files together, use buffered reads
-rw-r--r-- | src/compiler/scala/tools/ant/ScalaBazaar.scala | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/compiler/scala/tools/ant/ScalaBazaar.scala b/src/compiler/scala/tools/ant/ScalaBazaar.scala index 91656482c9..2520068650 100644 --- a/src/compiler/scala/tools/ant/ScalaBazaar.scala +++ b/src/compiler/scala/tools/ant/ScalaBazaar.scala @@ -265,10 +265,11 @@ package scala.tools.ant { log(file, Project.MSG_DEBUG) zip.putNextEntry(new ZipEntry(destFolder + "/" + file)) val input = new FileInputStream(nameToFile(srcFolder)(file)) - var byte = input.read() - while (byte != -1) { - zip.write (byte) - byte = input.read() + val buf = new Array[byte](10240) + var n = input.read(buf, 0, buf.length) + while (n >= 0) { + zip.write (buf, 0, n) + n = input.read(buf, 0, buf.length) } zip.closeEntry() input.close() |