Code example for Adler32

Methods: getValue, update

0
     * Originally from com.android.dx.dex.file.DexFile. 
     *  
     * @param bytes non-null; the bytes of the file 
     */ 
    private void calcChecksum(byte[] bytes) {
        Adler32 a32 = new Adler32();
 
        a32.update(bytes, 12, bytes.length - 12);
 
        int sum = (int) a32.getValue();
 
        bytes[8]  = (byte) sum;
        bytes[9]  = (byte) (sum >> 8);
        bytes[10] = (byte) (sum >> 16);
        bytes[11] = (byte) (sum >> 24);
    }    
 
    public void writeClassFile(Reader r, OutputStream rOs, boolean isDex) {
        ByteArrayOutputStream baos = new ByteArrayOutputStream(8192);
        BufferedReader br = new BufferedReader(r);
        String line;