Spreadsheet Toolkit

corpus.fileIO
Class Unzip

java.lang.Object
  |
  +--corpus.fileIO.Unzip

public class Unzip
extends java.lang.Object

http://www.javaworld.com/javaworld/jw-11-1998/jw-11-howto-p2.html

See Also:
Zip, ZipInfo, FileIO.byteA_to_object_zip(byte[])

Constructor Summary
Unzip(java.io.InputStream is)
          The zipfile will be read from the supplied InputStream
Unzip(java.lang.String path)
          The zipfile will be read from file on the end of the path
Unzip(java.util.zip.ZipFile zipfile)
          Reads out all zip entries and checks read byte size equals recorded byte size.
 
Method Summary
 java.util.Vector getData()
          Returns a Vector of elements that were read from the file.
static void main(java.lang.String[] rgstring)
          Run some decompression tests
 java.lang.String showEntries(java.util.zip.ZipFile zipfile)
          Returns a list of the elements in the Zip file.
static byte[] uncompress(byte[] data)
          Given a byte array will return the uncompressed zip version.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Unzip

public Unzip(java.lang.String path)
      throws java.io.FileNotFoundException,
             java.io.IOException
The zipfile will be read from file on the end of the path


Unzip

public Unzip(java.io.InputStream is)
The zipfile will be read from the supplied InputStream


Unzip

public Unzip(java.util.zip.ZipFile zipfile)
      throws java.io.IOException
Reads out all zip entries and checks read byte size equals recorded byte size.

Method Detail

getData

public java.util.Vector getData()
Returns a Vector of elements that were read from the file.


showEntries

public java.lang.String showEntries(java.util.zip.ZipFile zipfile)
Returns a list of the elements in the Zip file.


uncompress

public static byte[] uncompress(byte[] data)
                         throws java.io.IOException
Given a byte array will return the uncompressed zip version.

Returns:
The read data as a byte[] or null if the read failed.
java.io.IOException

main

public static void main(java.lang.String[] rgstring)
                 throws java.lang.Exception
Run some decompression tests

java.lang.Exception

Spreadsheet Toolkit

Project Home Page