1 Clazz.declarePackage ("javajs.util");
2 Clazz.load (null, "javajs.util.ZipData", ["javajs.util.Rdr", "$.ZipTools"], function () {
3 c$ = Clazz.decorateAsClass (function () {
8 Clazz.instantialize (this, arguments);
9 }, javajs.util, "ZipData");
10 Clazz.makeConstructor (c$,
14 Clazz.defineMethod (c$, "addBytes",
15 function (byteBuf, nSectorBytes, nBytesRemaining) {
17 if (!javajs.util.Rdr.isGzipB (byteBuf)) {
18 this.isEnabled = false;
20 }this.buf = Clazz.newByteArray (nBytesRemaining, 0);
21 }var nToAdd = Math.min (nSectorBytes, nBytesRemaining);
22 System.arraycopy (byteBuf, 0, this.buf, this.pt, nToAdd);
24 return nBytesRemaining - nToAdd;
26 Clazz.defineMethod (c$, "addTo",
27 function (jzt, data) {
28 data.append (javajs.util.ZipData.getGzippedBytesAsString (jzt, this.buf));
29 }, "javajs.api.GenericZipTools,javajs.util.SB");
30 c$.getGzippedBytesAsString = Clazz.defineMethod (c$, "getGzippedBytesAsString",
31 function (jzt, bytes) {
33 var bis = jzt.getUnGzippedInputStream (bytes);
34 var s = javajs.util.ZipTools.getStreamAsString (bis);
38 if (Clazz.exceptionOf (e, Exception)) {
44 }, "javajs.api.GenericZipTools,~A");