CheckedInputStream: read(byte[] b) : CheckedInputStream « java.util.zip « Java by API






CheckedInputStream: read(byte[] b)

 
import java.io.FileInputStream;
import java.util.zip.Adler32;
import java.util.zip.CheckedInputStream;

public class Main {
  public static void main(String[] argv) throws Exception {
    CheckedInputStream cis = new CheckedInputStream(new FileInputStream("filename"), new Adler32());
    byte[] tempBuf = new byte[128];
    while (cis.read(tempBuf) >= 0) {
    }
    long checksum = cis.getChecksum().getValue();
  }
}

   
  








Related examples in the same category

1.new CheckedInputStream(InputStream in, Checksum cksum)
2.CheckedInputStream: getChecksum()