/*
 * Created on 30.8.2005
 *
 */
package novotnyr.zip;

import java.io.FileInputStream;

import junit.framework.TestCase;

public class AutodetectingZipInputStreamTest extends TestCase {
    FileInputStream fileInputStream;
    AutodetectingZipInputStream autodetectIn;

    public static void main(String[] args) {
    }

    public AutodetectingZipInputStreamTest(String arg0) {
        super(arg0);
    }
    
    public void testDecompressCompressedFile() throws Exception {
        fileInputStream = new FileInputStream("d:\\Projects\\zip-autodetect\\test\\ximenez.zip");
        autodetectIn = new AutodetectingZipInputStream(fileInputStream);
        System.out.println(autodetectIn.isInputCompressed());
        for(int i = 0; i < 250; i++) {
            System.out.print((char)autodetectIn.read());
        }
        System.out.println();
    }

    public void testPassThroughCompressedFile() throws Exception {
        fileInputStream = new FileInputStream("d:\\Projects\\zip-autodetect\\test\\ximenez.zip");
        autodetectIn = new AutodetectingZipInputStream(fileInputStream, true);
        System.out.println(autodetectIn.isInputCompressed());
        for(int i = 0; i < 250; i++) {
            System.out.print((char)autodetectIn.read());
        }        
        System.out.println();
    }
    
    public void testPassThroughDecompressedFile() throws Exception {
        fileInputStream = new FileInputStream("d:\\Projects\\zip-autodetect\\test\\stopped services.txt");
        autodetectIn = new AutodetectingZipInputStream(fileInputStream, true);
        System.out.println(autodetectIn.isInputCompressed());
        for(int i = 0; i < 250; i++) {
            System.out.print((char)autodetectIn.read());
        }
        System.out.println();
    }
   
   
    protected void setUp() throws Exception {
        super.setUp();
    }

    protected void tearDown() throws Exception {
        super.tearDown();
    }

}
