List of usage examples for java.util.zip Deflater getBytesRead
public long getBytesRead()
From source file:com.moesol.keys.EncodeUidsTest.java
public void testCompress() { StringBuilder sb = new StringBuilder(); for (int i = 0; i < 10000; i++) { UUID id = UUID.randomUUID(); sb.append(id);/*www. j a va2 s . c om*/ sb.append(','); } String result = sb.toString(); // System.out.println("val=" + result); Deflater deflate = new Deflater(); try { byte[] compressed = new byte[512000]; deflate.setInput(result.getBytes()); deflate.finish(); System.out.printf("in=%d out=%d%n", deflate.getBytesRead(), deflate.getBytesWritten()); deflate.deflate(compressed); System.out.printf("in=%d out=%d%n", deflate.getBytesRead(), deflate.getBytesWritten()); } finally { deflate.end(); } }