Skip to content

Commit 4412da1

Browse files
spheroidcopybara-github
authored andcommitted
Copybara import of the project:
-- 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
1 parent ad42346 commit 4412da1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/google/crypto/tink/streamingaead/InputStreamDecrypter.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@ public synchronized int available() throws IOException {
121121
public synchronized int read() throws IOException {
122122
byte[] oneByte = new byte[1];
123123
if (read(oneByte) == 1) {
124-
return oneByte[0];
124+
return oneByte[0] & 0xff;
125125
}
126126
return -1;
127127
}

0 commit comments

Comments
 (0)