diff -r f08eb4df84c1 -r f203b54b3d33 vmtest/src/test/java/org/apidesign/bck2brwsr/tck/HttpResourceTest.java --- a/vmtest/src/test/java/org/apidesign/bck2brwsr/tck/HttpResourceTest.java Thu Jan 31 19:21:37 2013 +0100 +++ b/vmtest/src/test/java/org/apidesign/bck2brwsr/tck/HttpResourceTest.java Fri Feb 01 14:16:26 2013 +0100 @@ -17,6 +17,7 @@ */ package org.apidesign.bck2brwsr.tck; +import java.io.InputStream; import java.net.URL; import org.apidesign.bck2brwsr.core.JavaScriptBody; import org.apidesign.bck2brwsr.vmtest.BrwsrTest; @@ -65,6 +66,17 @@ assert arr.length == 1 : "One byte " + arr.length; assert arr[0] == 0xfe : "It is 0xfe: " + Integer.toHexString(arr[0]); } + + @HttpResource(path = "/bytes", content = "", resource = "0xfe", mimeType = "x-application/binary") + @BrwsrTest + public void testReadByteViaInputStream() throws Exception { + URL url = new URL("http:/bytes"); + InputStream is = url.openStream(); + byte[] arr = new byte[10]; + int len = is.read(arr); + assert len == 1 : "One byte " + len; + assert arr[0] == 0xfe : "It is 0xfe: " + Integer.toHexString(arr[0]); + } @JavaScriptBody(args = { "url" }, body = "var req = new XMLHttpRequest();\n"