Package java.util.zip

Examples of java.util.zip.CRC32.update()


  }

  public static Long uuid()
  {
    CRC32 crc32 = new CRC32();
    crc32.update(String.valueOf(java.util.UUID.randomUUID().toString()).getBytes());
    return crc32.getValue();
  }
}
View Full Code Here


  private String mallocPath() {
    while (true) {
     
      CRC32 crc32 = new CRC32();
      crc32.update(String.valueOf(java.util.UUID.randomUUID().toString()).getBytes());
      Long uuid=crc32.getValue();
      String pathname=String.valueOf(fmt.format(new Date())+"_"+status.uniqIndex.incrementAndGet()) + "_"  + uuid;
      File rtn = new File(new File(params.getIndexMalloc(pathname.hashCode()), "realtime"),pathname);
      if (rtn.exists()) {
        continue;
View Full Code Here

  }

  public void set(String item) {
    CRC32 crc32 = new CRC32();
    crc32.update(new String(item).getBytes());
    long crcvalue = crc32.getValue();
    this.add((int) crcvalue);
  }
 
  public void set(double item) {
View Full Code Here

    this.add((int) crcvalue);
  }
 
  public void set(double item) {
    CRC32 crc32 = new CRC32();
    crc32.update(ByteUtil.getBytes(item));
    long crcvalue = crc32.getValue();
    this.add((int) crcvalue);
  }
 
  public void set(int item) {
View Full Code Here

    this.add((int) crcvalue);
  }
 
  public void set(int item) {
    CRC32 crc32 = new CRC32();
    crc32.update(ByteUtil.getBytes(item));
    long crcvalue = crc32.getValue();
    this.add((int) crcvalue);
  }

  public Long getValue() {
View Full Code Here

public class SpoutUtils {
  public static Long uuid()
  {
    CRC32 crc32 = new CRC32();
    crc32.update(String.valueOf(java.util.UUID.randomUUID().toString()).getBytes());
    return crc32.getValue();
  }
}
View Full Code Here

      StringBuffer buff = new StringBuffer();
      buff.append(this.getClass().getName()).append("_");
      buff.append(this.directory.toString()).append("_");

      CRC32 crc32 = new CRC32();
      crc32.update(0);
      long filesize = 0;
      long filemodify = 0;

      if (filelist != null) {
        buff.append(filelist.length).append("_");
View Full Code Here

      long filemodify = 0;

      if (filelist != null) {
        buff.append(filelist.length).append("_");
        for (String s : filelist) {
          crc32.update(new String(s).getBytes());
          FileStatus fstatus=null;
          try {
            fstatus=this.fileStatus(s) ;
          } catch (Throwable e) {
            fstatus=null;
View Full Code Here

  private String mallocPath() {
    while (true) {
     
      CRC32 crc32 = new CRC32();
      crc32.update(String.valueOf(java.util.UUID.randomUUID().toString()).getBytes());
      Long uuid=crc32.getValue();
      String pathname=String.valueOf(fmt.format(new Date())+"_"+status.uniqIndex.incrementAndGet()) + "_"  + uuid;
      File rtn = new File(new File(params.getIndexMalloc(pathname.hashCode()), "realtime"),pathname);
      if (rtn.exists()) {
        continue;
View Full Code Here

  public long crc(String str) {
    final Checksum checksum = new CRC32();

    final byte bytes[] = str.getBytes();
    checksum.update(bytes,0,bytes.length);
    return checksum.getValue();
  }
 
  @BeforeClass
  @AfterClass
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.