summaryrefslogtreecommitdiff
path: root/src/library
diff options
context:
space:
mode:
authorBurak Emir <emir@epfl.ch>2008-04-06 20:35:30 +0000
committerBurak Emir <emir@epfl.ch>2008-04-06 20:35:30 +0000
commitf12696d5d7e7b89cbaa565e7a4c60138333e06b0 (patch)
tree13b43d59e1e0050910693f2f31f101ea77d6c600 /src/library
parent30610072ac6bec2c6e70dbb0e779f4a53bf39688 (diff)
downloadscala-f12696d5d7e7b89cbaa565e7a4c60138333e06b0.tar.gz
scala-f12696d5d7e7b89cbaa565e7a4c60138333e06b0.tar.bz2
scala-f12696d5d7e7b89cbaa565e7a4c60138333e06b0.zip
solved Walter Chang's slow InputStream issue (u...
solved Walter Chang's slow InputStream issue (using busy waiting).
Diffstat (limited to 'src/library')
-rw-r--r--src/library/jvm/scala/io/BufferedSource.scala5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/library/jvm/scala/io/BufferedSource.scala b/src/library/jvm/scala/io/BufferedSource.scala
index 2fae69fb10..5c49855ed4 100644
--- a/src/library/jvm/scala/io/BufferedSource.scala
+++ b/src/library/jvm/scala/io/BufferedSource.scala
@@ -59,7 +59,10 @@ abstract class BufferedSource(byteChannel: ReadableByteChannel, decoder: Charset
def fillBuffer() = {
byteBuffer.compact()
charBuffer.position(0)
- byteChannel.read(byteBuffer) match {
+ int num_bytes = 0;
+ while (0 == num_bytes)
+ num_bytes = byteChannel.read(byteBuffer)
+ num_bytes match {
case -1 =>
endOfInput = true;
byteBuffer.position(0)