Skip to content

Commit f1708e5

Browse files
hansonrhansonr
authored andcommitted
Zip clean up
1 parent 51998f1 commit f1708e5

File tree

8 files changed

+1845
-804
lines changed

8 files changed

+1845
-804
lines changed

sources/net.sf.j2s.java.core/src/javajs/util/CBZip2InputStream.java

Lines changed: 1206 additions & 0 deletions
Large diffs are not rendered by default.

sources/net.sf.j2s.java.core/src/javajs/util/CompoundDocument.java

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -27,14 +27,10 @@
2727
package javajs.util;
2828

2929

30-
import java.io.DataInputStream;
3130
import java.io.BufferedInputStream;
32-
33-
31+
import java.io.DataInputStream;
3432
import java.util.Map;
3533

36-
import javajs.api.GenericZipTools;
37-
3834

3935

4036
/* a simple compound document reader.
@@ -60,8 +56,6 @@ public class CompoundDocument extends BinaryDocument{
6056
Lst<CompoundDocDirEntry> directory = new Lst<CompoundDocDirEntry>();
6157
CompoundDocDirEntry rootEntry;
6258

63-
protected GenericZipTools jzt;
64-
6559
int[] SAT;
6660
int[] SSAT;
6761
int sectorSize;
@@ -77,8 +71,7 @@ public CompoundDocument(){
7771
this.isBigEndian = true;
7872
}
7973

80-
public void setDocStream(GenericZipTools jzt, BufferedInputStream bis) {
81-
this.jzt = jzt;
74+
public void setDocStream(BufferedInputStream bis) {
8275
if (!isRandom) {
8376
stream = new DataInputStream(bis);
8477
}
@@ -316,6 +309,7 @@ private SB getEntryAsString(CompoundDocDirEntry thisEntry, boolean asBinaryStrin
316309
thisEntry.SIDfirstSector, thisEntry.lenStream, asBinaryString)
317310
: getShortStringData(thisEntry.SIDfirstSector, thisEntry.lenStream, asBinaryString));
318311
}
312+
319313
private SB getStandardStringData(int thisSID, int nBytes,
320314
boolean asBinaryString) {
321315
SB data = new SB();
@@ -333,7 +327,7 @@ private SB getStandardStringData(int thisSID, int nBytes,
333327
System.out.println(e.toString());
334328
}
335329
if (gzipData.isEnabled)
336-
gzipData.addTo(jzt, data);
330+
gzipData.addTo(data);
337331
return data;
338332
}
339333

@@ -389,7 +383,7 @@ private SB getShortStringData(int shortSID, int nBytes, boolean asBinaryString)
389383
System.out.println("reader error in CompoundDocument " + e.toString());
390384
}
391385
if (gzipData.isEnabled)
392-
gzipData.addTo(jzt, data);
386+
gzipData.addTo(data);
393387
return data;
394388
}
395389
}

0 commit comments

Comments
 (0)