Skip to content

Commit b0618f2

Browse files
Comment
1 parent 599c615 commit b0618f2

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

firebase-firestore/src/main/java/com/google/firebase/firestore/util/ByteBufferInputStream.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,9 @@ public int read() {
3131
if (!buffer.hasRemaining()) {
3232
return -1;
3333
}
34+
// `& 0xFF` converts the signed byte value to an integer and then strips the first 3 bytes.
35+
// This keeps the last eight bits of the value and thereby translates the original byte value to
36+
// the [0, 255] range.
3437
return buffer.get() & 0xFF;
3538
}
3639

0 commit comments

Comments
 (0)