Skip to content

Commit

Permalink
Revert "Fix BufferedInputStream.read() for values bigger than 0x7f (s…
Browse files Browse the repository at this point in the history
…cala-native#1922)"

This reverts commit d4bbc6e.
  • Loading branch information
vicopem committed Nov 19, 2020
1 parent 6252f2c commit ad8d5bd
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 12 deletions.
2 changes: 1 addition & 1 deletion javalib/src/main/scala/java/io/BufferedInputStream.scala
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ class BufferedInputStream(_in: InputStream, size: Int)
ensureOpen()

if (prepareRead()) {
val res = buf(pos).toInt & 0xff
val res = buf(pos).toInt
pos += 1
res
} else -1
Expand Down
11 changes: 0 additions & 11 deletions unit-tests/src/test/scala/java/io/BufferedInputStreamSuite.scala
Original file line number Diff line number Diff line change
Expand Up @@ -38,17 +38,6 @@ object BufferedInputStreamSuite extends tests.Suite {

}

test("read value bigger than 0x7f") {
val inputArray = Array[Byte](0x85.toByte)

val arrayIn = new ByteArrayInputStream(inputArray)

val in = new BufferedInputStream(arrayIn)

assert(in.read() == 0x85)
assert(in.read() == -1)
}

test("read to closed buffer throws IOException") {

val inputArray =
Expand Down

0 comments on commit ad8d5bd

Please sign in to comment.