X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fswingjs%2Fj2s%2Fjssun%2Fmisc%2FResource.js;fp=site%2Fswingjs%2Fj2s%2Fjssun%2Fmisc%2FResource.js;h=72a1ae9c0728e899c939258a5bb78ef4c7832021;hp=8b43f16dc23f723eb1e9892ab931dbd25499efb0;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44 diff --git a/site/swingjs/j2s/jssun/misc/Resource.js b/site/swingjs/j2s/jssun/misc/Resource.js index 8b43f16..72a1ae9 100644 --- a/site/swingjs/j2s/jssun/misc/Resource.js +++ b/site/swingjs/j2s/jssun/misc/Resource.js @@ -1,86 +1,86 @@ -Clazz.declarePackage ("jssun.misc"); -Clazz.load (null, "jssun.misc.Resource", ["java.io.EOFException", "java.lang.Thread", "java.util.Arrays"], function () { -c$ = Clazz.decorateAsClass (function () { -this.cis = null; -Clazz.instantialize (this, arguments); -}, jssun.misc, "Resource"); -Clazz.defineMethod (c$, "cachedInputStream", - function () { -if (this.cis == null) { -this.cis = this.getInputStream (); -}return this.cis; -}); -Clazz.defineMethod (c$, "getBytes", -function () { -var b; -var $in = this.cachedInputStream (); -var isInterrupted = Thread.interrupted (); -var len; -for (; ; ) { -try { -len = this.getContentLength (); -break; -} catch (iioe) { -if (Clazz.exceptionOf (iioe, java.io.InterruptedIOException)) { -Thread.interrupted (); -isInterrupted = true; -} else { -throw iioe; -} -} -} -try { -b = Clazz.newByteArray (0, 0); -if (len == -1) len = 2147483647; -var pos = 0; -while (pos < len) { -var bytesToRead; -if (pos >= b.length) { -bytesToRead = Math.min (len - pos, b.length + 1024); -if (b.length < pos + bytesToRead) { -b = java.util.Arrays.copyOf (b, pos + bytesToRead); -}} else { -bytesToRead = b.length - pos; -}var cc = 0; -try { -cc = $in.read (b, pos, bytesToRead); -} catch (iioe) { -if (Clazz.exceptionOf (iioe, java.io.InterruptedIOException)) { -Thread.interrupted (); -isInterrupted = true; -} else { -throw iioe; -} -} -if (cc < 0) { -if (len != 2147483647) { -throw new java.io.EOFException ("Detect premature EOF"); -} else { -if (b.length != pos) { -b = java.util.Arrays.copyOf (b, pos); -}break; -}}pos += cc; -} -} finally { -try { -$in.close (); -} catch (e$$) { -if (Clazz.exceptionOf (e$$, java.io.InterruptedIOException)) { -var iioe = e$$; -{ -isInterrupted = true; -} -} else if (Clazz.exceptionOf (e$$, java.io.IOException)) { -var ignore = e$$; -{ -} -} else { -throw e$$; -} -} -if (isInterrupted) { -Thread.currentThread ().interrupt (); -}} -return b; -}); -}); +Clazz.declarePackage ("jssun.misc"); +Clazz.load (null, "jssun.misc.Resource", ["java.io.EOFException", "java.lang.Thread", "java.util.Arrays"], function () { +c$ = Clazz.decorateAsClass (function () { +this.cis = null; +Clazz.instantialize (this, arguments); +}, jssun.misc, "Resource"); +Clazz.defineMethod (c$, "cachedInputStream", + function () { +if (this.cis == null) { +this.cis = this.getInputStream (); +}return this.cis; +}); +Clazz.defineMethod (c$, "getBytes", +function () { +var b; +var $in = this.cachedInputStream (); +var isInterrupted = Thread.interrupted (); +var len; +for (; ; ) { +try { +len = this.getContentLength (); +break; +} catch (iioe) { +if (Clazz.exceptionOf (iioe, java.io.InterruptedIOException)) { +Thread.interrupted (); +isInterrupted = true; +} else { +throw iioe; +} +} +} +try { +b = Clazz.newByteArray (0, 0); +if (len == -1) len = 2147483647; +var pos = 0; +while (pos < len) { +var bytesToRead; +if (pos >= b.length) { +bytesToRead = Math.min (len - pos, b.length + 1024); +if (b.length < pos + bytesToRead) { +b = java.util.Arrays.copyOf (b, pos + bytesToRead); +}} else { +bytesToRead = b.length - pos; +}var cc = 0; +try { +cc = $in.read (b, pos, bytesToRead); +} catch (iioe) { +if (Clazz.exceptionOf (iioe, java.io.InterruptedIOException)) { +Thread.interrupted (); +isInterrupted = true; +} else { +throw iioe; +} +} +if (cc < 0) { +if (len != 2147483647) { +throw new java.io.EOFException ("Detect premature EOF"); +} else { +if (b.length != pos) { +b = java.util.Arrays.copyOf (b, pos); +}break; +}}pos += cc; +} +} finally { +try { +$in.close (); +} catch (e$$) { +if (Clazz.exceptionOf (e$$, java.io.InterruptedIOException)) { +var iioe = e$$; +{ +isInterrupted = true; +} +} else if (Clazz.exceptionOf (e$$, java.io.IOException)) { +var ignore = e$$; +{ +} +} else { +throw e$$; +} +} +if (isInterrupted) { +Thread.currentThread ().interrupt (); +}} +return b; +}); +});