Package java.util.zip

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


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


 
 
  public long getkeyCrc()
  {
    CRC32 crc32 = new CRC32();
    crc32.update(String.valueOf(this.key).getBytes());
    return crc32.getValue();
  }
  public ArrayList<Object> toNamedList()
  {
    if(iscrc)
View Full Code Here

     * <code>bytes</code>.
     */
    protected AbstractUnicodeExtraField(String text, byte[] bytes, int off,
                                        int len) {
        CRC32 crc32 = new CRC32();
        crc32.update(bytes, off, len);
        nameCRC32 = crc32.getValue();

        try {
            unicodeName = text.getBytes("UTF-8");
        } catch (UnsupportedEncodingException e) {
View Full Code Here

 
  public static String crcKey(IndexReader r)
  {
    String key= r.getStringCacheKey();
    CRC32 crc32 = new CRC32();
    crc32.update(new String(key).getBytes());
    long crcvalue = crc32.getValue();
   
    StringBuffer buff=new StringBuffer();
    buff.append(abs(key.hashCode()));
    buff.append("_");
View Full Code Here

    if(rtn.size()<=0)
    {
      return 0;
    }
    CRC32 crc32 = new CRC32();
    crc32.update(java.util.UUID.randomUUID().toString().getBytes());
    rtn.put("higo_uuid", Long.toString(crc32.getValue()));
    list.add(rtn);
    return 1;
  }
View Full Code Here

 
  public void setCrcRecord(String newparentGroup)
  {
    int len = newparentGroup.length();
    CRC32 crc32 = new CRC32();
    crc32.update(new String(newparentGroup).getBytes());
    int crcvalue = (int) crc32.getValue();
    int hashCode = newparentGroup.hashCode();
   
    ArrayList<Integer> key=new ArrayList<Integer>(3);
    key.add(crcvalue);
View Full Code Here

  }
 
  private long getkeyCrc()
  {
    CRC32 crc32 = new CRC32();
    crc32.update(String.valueOf(hostId+"@"+this.segKey).getBytes());
    return crc32.getValue();
  }
 
}
View Full Code Here

 

  private long getkeyCrc()
  {
    CRC32 crc32 = new CRC32();
    crc32.update(String.valueOf(hostId+"@"+this.segKey).getBytes());
    return crc32.getValue();
  }
 

View Full Code Here

      this.uni.setTmValueLong(termNum,Long.parseLong(this.uni.ft.indexedToReadable(t.text()))) ;
    } else if (this.uni.fieldDataType == FieldDatatype.d_double) {
      this.uni.setTmValueDouble(termNum, MdrillUtils.ParseDouble(this.uni.ft.indexedToReadable(t.text())));
    } else if (this.uni.fieldDataType == FieldDatatype.d_string) {// for dist
      CRC32 crc32 = new CRC32();
      crc32.update(new String(this.uni.ft.indexedToReadable(t.text())).getBytes());
      this.uni.setTmValueLong(termNum, crc32.getValue());
    }
  }

}
View Full Code Here

    return disposed;
  }
 
  public static long crc32(byte[] payload) {
    final Checksum checksum = new CRC32();
    checksum.update(payload,0,payload.length);
    return checksum.getValue();
  }

  public Pointer update(Pointer pointer, byte[] payload) {
    free(pointer);
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.