--- a/test/jdk/java/net/httpclient/ShortResponseBody.java Wed Jun 13 15:45:27 2018 +0100
+++ b/test/jdk/java/net/httpclient/ShortResponseBody.java Wed Jun 13 19:11:47 2018 +0100
@@ -29,11 +29,9 @@
* @build jdk.testlibrary.SimpleSSLContext
* @run testng/othervm
* -Djdk.httpclient.HttpClient.log=headers,errors
- * -Djdk.internal.httpclient.debug=true
* ShortResponseBody
* @run testng/othervm
* -Djdk.httpclient.HttpClient.log=headers,errors
- * -Djdk.internal.httpclient.debug=true
* -Djdk.httpclient.enableAllMethodRetry
* ShortResponseBody
*/
@@ -278,7 +276,12 @@
@Override
public int read(byte[] buf, int offset, int length) {
- return length;
+ //int count = offset;
+ //length = Math.max(0, Math.min(buf.length - offset, length));
+ //for (; count < length; count++)
+ // buf[offset++] = 0x01;
+ //return count;
+ return Math.max(0, Math.min(buf.length - offset, length));
}
}