Using GZIP streams to compress
First time poster, long time reader
I'm trying to write some serializable objects (ArrayLists) to file, but I wanted to compress them first. The GZIP stream isn't doing anything, even when it should. How should I be using it? Thanks if you can help
public void save( String filename )
{
try {
File file = new File( filename );
FileOutputStream outStream = new FileOutputStream( file );
GZIPOutputStream zipOut = new GZIPOutputStream( outStream );
ObjectOutputStream out = new ObjectOutputStream( zipOut );
out.writeObject( xList );
out.writeObject( yList );
out.writeObject( list );
out.close();
} catch (IOException e) {
System.exit( 1 );
}
}

