Closed
Description
I am trying to use binary input stream for my rest calls but the input stream get's truncated once first FF byte is encountered.
The reason is following part of PublisherInputStream class:
public int read() throws IOException {
...
ByteBuffer currentBuffer = chunk != null && !chunk.isReleased() ? chunk.data() : null;
...
if (currentBuffer != null && currentBuffer.remaining() > 0) {
return currentBuffer.get();
}
...
Here the FF byte is returned directly as int (== -1) which for input stream is interpreted as the end of stream.
The return currentBuffer.get(); line should be changed to currentBuffer.get() & 0xFF to return correct values.
Reported by Eva Krejcirova