test/jdk/java/net/httpclient/http2/ContinuationFrameTest.java
branchhttp-client-branch
changeset 56104 3420c1bdd254
parent 56092 fd85b2bf2b0d
child 56167 96fa4f49a9ff
equal deleted inserted replaced
56103:d5f70938e399 56104:3420c1bdd254
     1 /*
     1 /*
     2  * Copyright (c) 2017, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2017, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
   192         @Override
   192         @Override
   193         public void handle(Http2TestExchange t) throws IOException {
   193         public void handle(Http2TestExchange t) throws IOException {
   194             try (InputStream is = t.getRequestBody();
   194             try (InputStream is = t.getRequestBody();
   195                  OutputStream os = t.getResponseBody()) {
   195                  OutputStream os = t.getResponseBody()) {
   196                 byte[] bytes = is.readAllBytes();
   196                 byte[] bytes = is.readAllBytes();
   197                 t.getResponseHeaders().addHeader("just some", "noise");
   197                 t.getResponseHeaders().addHeader("justSome", "Noise");
   198                 t.getResponseHeaders().addHeader("to add ", "payload in ");
   198                 t.getResponseHeaders().addHeader("toAdd", "payload in");
   199                 t.getResponseHeaders().addHeader("the header", "frames");
   199                 t.getResponseHeaders().addHeader("theHeader", "Frames");
   200                 t.sendResponseHeaders(200, bytes.length);
   200                 t.sendResponseHeaders(200, bytes.length);
   201                 os.write(bytes);
   201                 os.write(bytes);
   202             }
   202             }
   203         }
   203         }
   204     }
   204     }