--- old/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Stream.java 2018-01-22 16:49:06.000000000 +0000 +++ new/src/jdk.incubator.httpclient/share/classes/jdk/incubator/http/Stream.java 2018-01-22 16:49:05.000000000 +0000 @@ -767,7 +767,7 @@ // blocks waiting for stream send window, if exhausted int actualAmount = windowController.tryAcquire(requestAmount, streamid, this); if (actualAmount <= 0) return null; - ByteBuffer outBuf = Utils.slice(buffer, actualAmount); + ByteBuffer outBuf = Utils.sliceWithLimitedCapacity(buffer, actualAmount); DataFrame df = new DataFrame(streamid, 0 , outBuf); return df; }