File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
sources/net.sf.j2s.java.core/src/test Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change 11package test ;
22
33import java .io .BufferedInputStream ;
4+ import java .io .File ;
5+ import java .io .FileInputStream ;
46import java .io .InputStream ;
57import java .net .URL ;
68import java .util .zip .ZipEntry ;
79import java .util .zip .ZipInputStream ;
810
11+ import javajs .util .Rdr ;
12+ import javajs .util .ZipTools ;
13+
914public class Test_Zipin extends Test_ {
1015
1116 public static void main (String [] args ) {
1217
1318 try {
19+ InputStream bzis = Test_Zipin .class .getResourceAsStream ("test2.txt.bz2" );
20+ bzis = ZipTools .newBZip2InputStream (bzis );
21+ String s = new String ((byte []) Rdr .getStreamAsBytes (new BufferedInputStream (bzis ), null ), "utf-8" );
22+ System .out .println (s );
23+ assert (s .equals ("test2 here" ));
24+ bzis .close ();
25+
26+
1427 String path = (/** @j2sNative 1?"https://./swingjs/j2s/test/t.zip":*/ "https://chemapps.stolaf.edu/jmol/jsmol/data/sage.zip" );
1528 URL url = new URL (path );
1629 System .out .println ("getting " + url );
You can’t perform that action at this time.
0 commit comments