X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fswingjs%2Fj2s%2Fjssun%2Fmisc%2FIOUtils.js;fp=site%2Fswingjs%2Fj2s%2Fjssun%2Fmisc%2FIOUtils.js;h=1ded1b55e2eff2f585459fba963016c7585cff7a;hp=2b60be6d13bc5f1a41b7388669d7666678f92278;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44 diff --git a/site/swingjs/j2s/jssun/misc/IOUtils.js b/site/swingjs/j2s/jssun/misc/IOUtils.js index 2b60be6..1ded1b5 100644 --- a/site/swingjs/j2s/jssun/misc/IOUtils.js +++ b/site/swingjs/j2s/jssun/misc/IOUtils.js @@ -1,29 +1,29 @@ -Clazz.declarePackage ("jssun.misc"); -Clazz.load (null, "jssun.misc.IOUtils", ["java.io.EOFException", "java.util.Arrays"], function () { -c$ = Clazz.declareType (jssun.misc, "IOUtils"); -c$.readFully = Clazz.defineMethod (c$, "readFully", -function (is, length, readAll) { -var output = Clazz.newByteArray (-1, []); -if (length == -1) length = 2147483647; -var pos = 0; -while (pos < length) { -var bytesToRead; -if (pos >= output.length) { -bytesToRead = Math.min (length - pos, output.length + 1024); -if (output.length < pos + bytesToRead) { -output = java.util.Arrays.copyOf (output, pos + bytesToRead); -}} else { -bytesToRead = output.length - pos; -}var cc = is.read (output, pos, bytesToRead); -if (cc < 0) { -if (readAll && length != 2147483647) { -throw new java.io.EOFException ("Detect premature EOF"); -} else { -if (output.length != pos) { -output = java.util.Arrays.copyOf (output, pos); -}break; -}}pos += cc; -} -return output; -}, "java.io.InputStream,~N,~B"); -}); +Clazz.declarePackage ("jssun.misc"); +Clazz.load (null, "jssun.misc.IOUtils", ["java.io.EOFException", "java.util.Arrays"], function () { +c$ = Clazz.declareType (jssun.misc, "IOUtils"); +c$.readFully = Clazz.defineMethod (c$, "readFully", +function (is, length, readAll) { +var output = Clazz.newByteArray (-1, []); +if (length == -1) length = 2147483647; +var pos = 0; +while (pos < length) { +var bytesToRead; +if (pos >= output.length) { +bytesToRead = Math.min (length - pos, output.length + 1024); +if (output.length < pos + bytesToRead) { +output = java.util.Arrays.copyOf (output, pos + bytesToRead); +}} else { +bytesToRead = output.length - pos; +}var cc = is.read (output, pos, bytesToRead); +if (cc < 0) { +if (readAll && length != 2147483647) { +throw new java.io.EOFException ("Detect premature EOF"); +} else { +if (output.length != pos) { +output = java.util.Arrays.copyOf (output, pos); +}break; +}}pos += cc; +} +return output; +}, "java.io.InputStream,~N,~B"); +});