@@ -135,6 +135,17 @@ public int read(byte[] b, int off, int len) throws IOException {
135135 return 0 ;
136136 }
137137
138+ // TODO : Re: Compression - fixedLength and Content-Length needs to account for the Content-Length referring to the compressed body.
139+
140+ // Preamble, this could push back compressed bytes.
141+ // Pushback > Throughput > Socket
142+ //
143+ // HTTPInputStream (this) -> Decompress > Pushback > Throughput > Socket
144+ // HTTPInputStream (this) -> Decompress > Chunked > Pushback > Throughput > Socket
145+ //
146+ // Pushback doesn't care if the bytes are compressed or not, it is up to the caller?
147+ //
148+
138149 // If this is a fixed length request, and we have less than or equal to 0 bytes remaining, return -1
139150 boolean fixedLength = !request .isChunked ();
140151 if (fixedLength && bytesRemaining <= 0 ) {
@@ -147,7 +158,11 @@ public int read(byte[] b, int off, int len) throws IOException {
147158
148159 // When we have a fixed length request, read beyond the remainingBytes if possible.
149160 // - If we have read past the end of the current request, push those bytes back onto the InputStream.
150- int read = delegate .read (b , off , len );
161+ // TODO : Can I optionally never override here? If I am fixed length, I could change len -> maxLen., and then never pushback.
162+ // Would this help with compression?
163+ // int maxLen = (int) Math.min(len, bytesRemaining);
164+ int maxLen = len ;
165+ int read = delegate .read (b , off , maxLen );
151166 if (fixedLength && read > 0 ) {
152167 int extraBytes = (int ) (read - bytesRemaining );
153168 if (extraBytes > 0 ) {
0 commit comments