Package com.emc.vipr.transform.util

Examples of com.emc.vipr.transform.util.CountingOutputStream


     * @param arg0
     * @throws IOException
     */
    public DeflateOutputStream(OutputStream streamToCompress, int level) throws IOException {
        Deflater def = new Deflater(level);
        compressedCounter = new CountingOutputStream(streamToCompress);
        DeflaterOutputStream dos = new DeflaterOutputStream(compressedCounter, def);
        uncompressedCounter = new CountingOutputStream(dos);
        try {
            digester = new DigestOutputStream(uncompressedCounter, MessageDigest.getInstance("SHA1"));
        } catch (NoSuchAlgorithmException e) {
            throw new IOException("Unable to initialize digest", e);
        }
View Full Code Here


   
   
    static ThreadGroup LZ_COMP_TG = new ThreadGroup("LZMACompress");
   
    public LZMAOutputStream(OutputStream out, LzmaProfile compressionProfile) throws IOException {
        compressedOutput = new CountingOutputStream(out);
        closed = false;
        uncompressedDigest = new byte[0];
       
        // The LZMA Encoder requires an input stream and thus does not make a good
        // filter.  We need to create a pipe and and use an auxiliary thread to compress
        // the data.
        inputPipe = new PipedInputStream();
        uncompressedSize = new CountingOutputStream(new PipedOutputStream((PipedInputStream) inputPipe));
        try {
            outputPipe = new DigestOutputStream(uncompressedSize, MessageDigest.getInstance("SHA1"));
        } catch (NoSuchAlgorithmException e) {
           throw new IOException("Could not create LZMAOutputStream", e);
        }
View Full Code Here

    /**
     * @throws IOException
     */
    public DeflateOutputStream(OutputStream streamToCompress, int level) throws IOException {
        Deflater def = new Deflater(level);
        compressedCounter = new CountingOutputStream(streamToCompress);
        DeflaterOutputStream dos = new DeflaterOutputStream(compressedCounter, def);
        uncompressedCounter = new CountingOutputStream(dos);
        try {
            digester = new DigestOutputStream(uncompressedCounter, MessageDigest.getInstance("SHA1"));
        } catch (NoSuchAlgorithmException e) {
            throw new IOException("Unable to initialize digest", e);
        }
View Full Code Here

        // CountingOutputStream->DigestOutputStream(opt)->CipherOutputStream->
        // user output stream.
        CipherOutputStream cipherStream = new CipherOutputStream(out, cipher);
        if(digest != null) {
            digestStream = new DigestOutputStream(cipherStream, digest);
            counterStream = new CountingOutputStream(digestStream);
        } else {
            counterStream = new CountingOutputStream(cipherStream);
        }
    }
View Full Code Here

TOP

Related Classes of com.emc.vipr.transform.util.CountingOutputStream

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.