Skip to content

Commit

Permalink
Copybara import of the project:
Browse files Browse the repository at this point in the history
--
5c8e998 by Henry Jalonen <henkka@spheroid.fi>:

Make InputStreamDecrypter.read() InputStream compliant

Convert the read signed integer to unsigned before returning it, because it is the behavior defined in the InputStream interface. It also makes it possible to distinguish between errors and successful read operations.

Fixes #10.

PiperOrigin-RevId: 567219401
Change-Id: Ie6f2726e2a5bfd71015022c24463d7bd41357d16
  • Loading branch information
spheroid authored and copybara-github committed Sep 21, 2023
1 parent ad42346 commit 4412da1
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ public synchronized int available() throws IOException {
public synchronized int read() throws IOException {
byte[] oneByte = new byte[1];
if (read(oneByte) == 1) {
return oneByte[0];
return oneByte[0] & 0xff;
}
return -1;
}
Expand Down

0 comments on commit 4412da1

Please sign in to comment.