Package backtype.storm.utils

Source Code of backtype.storm.utils.CRC32OutputStream

package backtype.storm.utils;

import java.io.IOException;
import java.io.OutputStream;
import java.util.zip.CRC32;

public class CRC32OutputStream extends OutputStream {
    private CRC32 hasher;
   
    public CRC32OutputStream() {
        hasher = new CRC32();
    }
   
    public long getValue() {
        return hasher.getValue();
    }

    @Override
    public void write(int i) throws IOException {
        hasher.update(i);
    }

    @Override
    public void write(byte[] bytes, int start, int end) throws IOException {
        hasher.update(bytes, start, end);
    }   
}
TOP

Related Classes of backtype.storm.utils.CRC32OutputStream

TOP
Copyright © 2018 www.massapi.com. 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.