Alternatively, we could return {@code true} from {@link #hasNext()} even if we don't know thatwe will read -1, but then when {@link #next()} reads -1 it must return an empty buffer.However this is problematic, since GETs with no content indication would become GET with chunked content, and not understood by servers.
Therefore we need to make sure that {@link #hasNext()} does not perform any side effect (so thatit can be called multiple times) until {@link #next()} is called.
|
|
|
|
|
|
|
|
|
|