this.out = out;
switch (algorithm)
{
case PGPCompressedData.ZIP:
pkOut = new BCPGOutputStream(out, PacketTags.COMPRESSED_DATA, buffer);
pkOut.write(PGPCompressedData.ZIP);
dOut = new DeflaterOutputStream(pkOut, new Deflater(compression, true));
break;
case PGPCompressedData.ZLIB:
pkOut = new BCPGOutputStream(out, PacketTags.COMPRESSED_DATA, buffer);
pkOut.write(PGPCompressedData.ZLIB);
dOut = new DeflaterOutputStream(pkOut, new Deflater(compression));
break;
case PGPCompressedData.BZIP2:
pkOut = new BCPGOutputStream(out, PacketTags.COMPRESSED_DATA, buffer);
pkOut.write(PGPCompressedData.BZIP2);
dOut = new CBZip2OutputStream(pkOut);
break;
case PGPCompressedData.UNCOMPRESSED:
pkOut = new BCPGOutputStream(out, PacketTags.COMPRESSED_DATA, buffer);
pkOut.write(PGPCompressedData.UNCOMPRESSED);
dOut = pkOut;
break;
default:
throw new IllegalStateException("generator not initialised");