Package com.google.appengine.tools.mapreduce.impl.util

Examples of com.google.appengine.tools.mapreduce.impl.util.Crc32c.update()


  private static boolean isValidCrc(int checksum, ByteBuffer data, byte type) {
    if (checksum == 0 && type == 0) {
      return true;
    }
    Crc32c crc = new Crc32c();
    crc.update(type);
    crc.update(data.array(), 0, data.limit());

    return LevelDbConstants.unmaskCrc(checksum) == crc.getValue();
  }
View Full Code Here


    if (checksum == 0 && type == 0) {
      return true;
    }
    Crc32c crc = new Crc32c();
    crc.update(type);
    crc.update(data.array(), 0, data.limit());

    return LevelDbConstants.unmaskCrc(checksum) == crc.getValue();
  }

  /**
 
View Full Code Here

   *        checksum.
   * @return the masked checksum.
   */
  private int generateCrc(byte[] data, int off, int len, RecordType type) {
    Crc32c crc = new Crc32c();
    crc.update(type.value());
    crc.update(data, off, len);
    return (int) LevelDbConstants.maskCrc(crc.getValue());
  }

  /**
 
View Full Code Here

   * @return the masked checksum.
   */
  private int generateCrc(byte[] data, int off, int len, RecordType type) {
    Crc32c crc = new Crc32c();
    crc.update(type.value());
    crc.update(data, off, len);
    return (int) LevelDbConstants.maskCrc(crc.getValue());
  }

  /**
   * Adds padding to the stream until to the end of the block.
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.