Package com.ning.compress.gzip

Examples of com.ning.compress.gzip.OptimizedGZIPOutputStream


            final long start = System.currentTimeMillis();

            int reps = REPS;
            while (--reps >= 0) {
                bytes.reset();
                OptimizedGZIPOutputStream out = new OptimizedGZIPOutputStream(bytes);
                out.write(inputs[i]);
                out.close();
            }               
            size += bytes.size();
            msecs[i] = (int) (System.currentTimeMillis() - start);
        }
        return System.currentTimeMillis() - mainStart;
View Full Code Here


    public static byte[] gzipCompress(byte[] data, int offset, int len) throws IOException
    {
        // assume 50% compression rate
        ByteArrayOutputStream bytes = new ByteArrayOutputStream(len>>1);
        OptimizedGZIPOutputStream out = new OptimizedGZIPOutputStream(bytes);
        out.write(data, offset, len);
        out.close();
        return bytes.toByteArray();
    }
View Full Code Here

    public static byte[] gzipCompress(ByteContainer data) throws IOException
    {
        // assume 50% compression rate
        ByteArrayOutputStream bytes = new ByteArrayOutputStream(data.byteLength()>>1);
        OptimizedGZIPOutputStream out = new OptimizedGZIPOutputStream(bytes);
        data.writeBytes(out);
        out.close();
        return bytes.toByteArray();
    }
View Full Code Here

            case NONE:
                break;
            case LZF:
                return new LZFOutputStream(out);
            case GZIP:
                return new OptimizedGZIPOutputStream(out);
            default: // sanity check
                throw new IllegalArgumentException("Unrecognized compression type: "+comp);
            }
        }
        return out;
View Full Code Here

TOP

Related Classes of com.ning.compress.gzip.OptimizedGZIPOutputStream

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.