FileDocCategorySizeDatePackage
NIOUnzipper.javaAPI DocExample588Tue Feb 14 06:14:16 GMT 2006None

NIOUnzipper

public class NIOUnzipper extends Object

Fields Summary
Constructors Summary
Methods Summary
public static voidmain(java.lang.String[] args)


    FileInputStream fin = new FileInputStream(args[0]);      
    GZIPInputStream gzin = new GZIPInputStream(fin);
    ReadableByteChannel in = Channels.newChannel(gzin);
    
    WritableByteChannel out = Channels.newChannel(System.out);
    ByteBuffer buffer = ByteBuffer.allocate(65536);
    while (in.read(buffer) != -1) {
      buffer.flip();
      out.write(buffer);
      buffer.clear();
    }