Examples of Adler32


Examples of java.util.zip.Adler32

    /**
     * creates a checksum alogrithm to be used
     * @return the checksum used for this txnlog
     */
    protected Checksum makeChecksumAlgorithm(){
        return new Adler32();
    }
View Full Code Here

Examples of java.util.zip.Adler32

        /**
         * create a checksum algorithm
         * @return the checksum algorithm
         */
        protected Checksum makeChecksumAlgorithm(){
            return new Adler32();
        }
View Full Code Here

Examples of java.util.zip.Adler32

    Inflater inflateDiction = new Inflater();
    inflateDiction.setInput(outPutDiction);
    if (inflateDiction.needsDictionary() == true) {
      // getting the checkSum value through the Adler32 class
      Adler32 adl = new Adler32();
      adl.update(dictionaryArray);
      long checkSumR = adl.getValue();
      assertTrue(
          "the checksum value returned by getAdler() is not the same as the checksum returned by creating the adler32 instance",
          checkSumR == inflateDiction.getAdler());
    }
  }
View Full Code Here

Examples of java.util.zip.Adler32

    if (classPrefix == null) {
      /*
       * Note that the checksum will miss some or all of the subtypes generated
       * by other generators.
       */
      Adler32 checksum = new Adler32();
      for (JClassType type : cssResourceSubtypes) {
        checksum.update(Util.getBytes(type.getQualifiedSourceName()));
      }
      classPrefix = "G"
          + Long.toString(checksum.getValue(), Character.MAX_RADIX);
    }

    return classPrefix;
  }
View Full Code Here

Examples of java.util.zip.Adler32

    Inflater inflateDiction = new Inflater();
    inflateDiction.setInput(outPutDiction);
    if (inflateDiction.needsDictionary() == true) {
      // getting the checkSum value through the Adler32 class
      Adler32 adl = new Adler32();
      adl.update(dictionaryArray);
      long checkSumR = adl.getValue();
      assertTrue(
          "the checksum value returned by getAdler() is not the same as the checksum returned by creating the adler32 instance",
          checkSumR == inflateDiction.getAdler());
    }
  }
View Full Code Here

Examples of java.util.zip.Adler32

          System.out.println("EOF reached after " + count + " txns.");
        }

        return;
      }
      Checksum crc = new Adler32();
      crc.update(bytes, 0, bytes.length);
      if (crcValue != crc.getValue()) {
        throw new IOException("CRC doesn't match " + crcValue + " vs " + crc.getValue());
      }
      InputArchive iab = BinaryInputArchive.getArchive(new ByteArrayInputStream(bytes));
      TxnHeader hdr = new TxnHeader();
      Record txn = SerializeUtils.deserializeTxn(iab, hdr);
      if (bw != null) {
View Full Code Here

Examples of java.util.zip.Adler32

public class Adler32CheckSum extends CheckSum {

    private Adler32 checkSumGenerator = null;

    public Adler32CheckSum() {
        checkSumGenerator = new Adler32();
    }
View Full Code Here

Examples of java.util.zip.Adler32

    /** Since {@link #equals} depends on the contents of memory, use that
     * as the basis for the hash code.
     */
    public int hashCode() {
        clear(); write();
        Adler32 code = new Adler32();
        code.update(getPointer().getByteArray(0, size()));
        return (int)code.getValue();
    }
View Full Code Here

Examples of java.util.zip.Adler32

    /** Since {@link #equals} depends on the contents of memory, use that
     * as the basis for the hash code.
     */
    public int hashCode() {
        clear(); write();
        Adler32 code = new Adler32();
        code.update(getPointer().getByteArray(0, size()));
        return (int)code.getValue();
    }
View Full Code Here

Examples of java.util.zip.Adler32

    /**
     * creates a checksum alogrithm to be used
     * @return the checksum used for this txnlog
     */
    protected Checksum makeChecksumAlgorithm(){
        return new Adler32();
    }
View Full Code Here
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.