X-Git-Url: http://source.jalview.org/gitweb/?p=jalviewjs.git;a=blobdiff_plain;f=site%2Fj2s%2FJU%2FZipData.js;fp=site%2Fj2s%2FJU%2FZipData.js;h=643fddd1ab11eadf8b882c2354fe48545fd1bbbe;hp=6f2f11c92beb6f303346bed051501d2f84cb6468;hb=b9b7a352eee79b7764c3b09c9d19663075061d8c;hpb=7301a2415adab88038b291fc54caeeb3a5a47a44 diff --git a/site/j2s/JU/ZipData.js b/site/j2s/JU/ZipData.js index 6f2f11c..643fddd 100644 --- a/site/j2s/JU/ZipData.js +++ b/site/j2s/JU/ZipData.js @@ -1,45 +1,45 @@ -Clazz.declarePackage ("JU"); -Clazz.load (null, "JU.ZipData", ["JU.Rdr", "$.ZipTools"], function () { -c$ = Clazz.decorateAsClass (function () { -this.isEnabled = true; -this.buf = null; -this.pt = 0; -this.nBytes = 0; -Clazz.instantialize (this, arguments); -}, JU, "ZipData"); -Clazz.makeConstructor (c$, -function (nBytes) { -this.nBytes = nBytes; -}, "~N"); -Clazz.defineMethod (c$, "addBytes", -function (byteBuf, nSectorBytes, nBytesRemaining) { -if (this.pt == 0) { -if (!JU.Rdr.isGzipB (byteBuf)) { -this.isEnabled = false; -return -1; -}this.buf = Clazz.newByteArray (nBytesRemaining, 0); -}var nToAdd = Math.min (nSectorBytes, nBytesRemaining); -System.arraycopy (byteBuf, 0, this.buf, this.pt, nToAdd); -this.pt += nToAdd; -return nBytesRemaining - nToAdd; -}, "~A,~N,~N"); -Clazz.defineMethod (c$, "addTo", -function (jzt, data) { -data.append (JU.ZipData.getGzippedBytesAsString (jzt, this.buf)); -}, "javajs.api.GenericZipTools,JU.SB"); -c$.getGzippedBytesAsString = Clazz.defineMethod (c$, "getGzippedBytesAsString", -function (jzt, bytes) { -try { -var bis = jzt.getUnGzippedInputStream (bytes); -var s = JU.ZipTools.getStreamAsString (bis); -bis.close (); -return s; -} catch (e) { -if (Clazz.exceptionOf (e, Exception)) { -return ""; -} else { -throw e; -} -} -}, "javajs.api.GenericZipTools,~A"); -}); +Clazz.declarePackage ("JU"); +Clazz.load (null, "JU.ZipData", ["JU.Rdr", "$.ZipTools"], function () { +c$ = Clazz.decorateAsClass (function () { +this.isEnabled = true; +this.buf = null; +this.pt = 0; +this.nBytes = 0; +Clazz.instantialize (this, arguments); +}, JU, "ZipData"); +Clazz.makeConstructor (c$, +function (nBytes) { +this.nBytes = nBytes; +}, "~N"); +Clazz.defineMethod (c$, "addBytes", +function (byteBuf, nSectorBytes, nBytesRemaining) { +if (this.pt == 0) { +if (!JU.Rdr.isGzipB (byteBuf)) { +this.isEnabled = false; +return -1; +}this.buf = Clazz.newByteArray (nBytesRemaining, 0); +}var nToAdd = Math.min (nSectorBytes, nBytesRemaining); +System.arraycopy (byteBuf, 0, this.buf, this.pt, nToAdd); +this.pt += nToAdd; +return nBytesRemaining - nToAdd; +}, "~A,~N,~N"); +Clazz.defineMethod (c$, "addTo", +function (jzt, data) { +data.append (JU.ZipData.getGzippedBytesAsString (jzt, this.buf)); +}, "javajs.api.GenericZipTools,JU.SB"); +c$.getGzippedBytesAsString = Clazz.defineMethod (c$, "getGzippedBytesAsString", +function (jzt, bytes) { +try { +var bis = jzt.getUnGzippedInputStream (bytes); +var s = JU.ZipTools.getStreamAsString (bis); +bis.close (); +return s; +} catch (e) { +if (Clazz.exceptionOf (e, Exception)) { +return ""; +} else { +throw e; +} +} +}, "javajs.api.GenericZipTools,~A"); +});