7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 */
24 package java.net.http;
25
26 import java.io.IOException;
27 import java.net.URI;
28 import java.nio.ByteBuffer;
29 import java.util.List;
30 import java.util.Map;
31 import java.util.Set;
32 import java.util.function.LongConsumer;
33 import static java.net.http.HttpClient.Version.HTTP_1_1;
34
35 /**
36 * Handles a HTTP/1.1 response in two blocking calls. readHeaders() and
37 * readBody(). There can be more than one of these per Http exchange.
38 */
39 class Http1Response {
40
41 private ResponseContent content;
42 private final HttpRequestImpl request;
43 HttpResponseImpl response;
44 private final HttpConnection connection;
45 private ResponseHeaders headers;
46 private int responseCode;
47 private ByteBuffer buffer; // same buffer used for reading status line and headers
|
7 * published by the Free Software Foundation. Oracle designates this
8 * particular file as subject to the "Classpath" exception as provided
9 * by Oracle in the LICENSE file that accompanied this code.
10 *
11 * This code is distributed in the hope that it will be useful, but WITHOUT
12 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
13 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
14 * version 2 for more details (a copy is included in the LICENSE file that
15 * accompanied this code).
16 *
17 * You should have received a copy of the GNU General Public License version
18 * 2 along with this work; if not, write to the Free Software Foundation,
19 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
20 *
21 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
22 * or visit www.oracle.com if you need additional information or have any
23 */
24 package java.net.http;
25
26 import java.io.IOException;
27 import java.nio.ByteBuffer;
28 import java.util.List;
29 import java.util.Map;
30 import java.util.Set;
31 import java.util.function.LongConsumer;
32 import static java.net.http.HttpClient.Version.HTTP_1_1;
33
34 /**
35 * Handles a HTTP/1.1 response in two blocking calls. readHeaders() and
36 * readBody(). There can be more than one of these per Http exchange.
37 */
38 class Http1Response {
39
40 private ResponseContent content;
41 private final HttpRequestImpl request;
42 HttpResponseImpl response;
43 private final HttpConnection connection;
44 private ResponseHeaders headers;
45 private int responseCode;
46 private ByteBuffer buffer; // same buffer used for reading status line and headers
|