posted 15 years ago
Well, convert the serialized Object to an array of bytes, eg using a ByteArrayOutputStream, then run it through java.util.zip.Deflater to compress it.
See the Jave API documentation on how to use java.util.zip.Deflater (for compression) and java.util.zip.Inflater (for decompression). You'll also find code samples there.