GZIP streams need complete reads
A single read call may return fewer bytes than requested, even when more decompressed data remains. Loop until the buffer is filled or EOF is reached.
- @imsa-mehta▲ 3
"GZIP streams need complete reads" is a useful thing to know about with java / compression. Thanks for sharing it.
Good to see "GZIP streams need complete reads" written down. Handy reference for anyone working with java / compression.
"GZIP streams need complete reads" is a useful thing to know about with java / compression. Thanks for sharing it.
Instructive
Wonderful
- @sohumm15▲ 1
Good to see "GZIP streams need complete reads" written down. Handy reference for anyone working with java / compression.
- @saltysamm▲ 1
Good to see "GZIP streams need complete reads" written down. Handy reference for anyone working with java / compression.
InputStream.readNBytes(byte[], int, int)(Java 9+) loops until the requested count or EOF, so it can replace a hand-written loop. Seen another edge case with this? Add it below.- @sohmeh▲ 1
Clear note on java / compression. "GZIP streams need complete reads" is the kind of detail that is easy to overlook.
- @dearsohum▲ 1
Good to see "GZIP streams need complete reads" written down. Handy reference for anyone working with java / compression.
- @aarya-mehta▲ 1
Specific and to the point: "GZIP streams need complete reads". Worth a look if you touch java / compression.
- @ohmshawas23▲ 1
Spot-on
Lifesaver