A simple example of usage.
CMSCompressedDataStreamGenerator gen = new CMSCompressedDataStreamGenerator(); OutputStream cOut = gen.open(outputStream, CMSCompressedDataStreamGenerator.ZLIB); cOut.write(data); cOut.close();
120121122123124125126127128129130131132
} public void write(OutputStream out) throws IOException { CMSCompressedDataStreamGenerator cGen = new CMSCompressedDataStreamGenerator(); OutputStream compressed = cGen.open(out, _compressionOid); try { _content.writeTo(compressed);
7677787980818283848586878889
public void testEach() throws Exception { byte[] testData = "Hello world!".getBytes(); CMSCompressedDataStreamGenerator gen = new CMSCompressedDataStreamGenerator(); ByteArrayOutputStream bOut = new ByteArrayOutputStream(); OutputStream cOut = gen.open(bOut, CMSCompressedDataStreamGenerator.ZLIB); cOut.write(testData); cOut.close();
100101102103104105106107108109110111112113
rand.setSeed(0); for (int i = 0; i != 10; i++) { CMSCompressedDataStreamGenerator gen = new CMSCompressedDataStreamGenerator(); ByteArrayOutputStream bOut = new ByteArrayOutputStream(); OutputStream cOut = gen.open(bOut, CMSCompressedDataStreamGenerator.ZLIB); rand.nextBytes(testData); cOut.write(testData);