I have a class which has a method that is receiving an object as a parameter. This method is invoked via RMI.
public RMIClass extends Serializable {
pub
Look at those samples, and wherever they're using FileOutputStream, use ByteArrayOutputStream instead. Wherever they're using FileInputStream, use ByteArrayInputStream instead. The rest should be simple.
Why don't you create your own class that extends OutputStream or , whatever is the archive writing to ?
Wrap your byte array with a ByteArrayInputStream and feed it into a GZipInputStream
If you want to write to a ByteBuffer you can do this.
private static void uncompress(final byte[] input, final ByteBuffer output) throws IOException
{
final GZIPInputStream inputGzipStream = new GZIPInputStream(new ByteArrayInputStream(input));
Channels.newChannel(inputGzipStream).read(output);
}