Tabnine Logo
Checksum.reset
Code IndexAdd Tabnine to your IDE (free)

How to use
reset
method
in
java.util.zip.Checksum

Best Java code snippets using java.util.zip.Checksum.reset (Showing top 20 results out of 783)

origin: netty/netty

  @Override
  public void reset() {
    checksum.reset();
  }
}
origin: redisson/redisson

  @Override
  public void reset() {
    checksum.reset();
  }
}
origin: wildfly/wildfly

  @Override
  public void reset() {
    checksum.reset();
  }
}
origin: org.apache.hadoop/hadoop-common

 private void resetState() {
  // invalidate buffer
  count = 0;
  pos = 0;
  // reset Checksum
  if (sum != null) {
   sum.reset();
  }
 }
}
origin: org.apache.hadoop/hadoop-common

@Override
public void reset() {
 summer.reset();
 inSum = 0;
}
origin: org.apache.lucene/lucene-core

@Override
public void reset() {
 upto = 0;
 in.reset();
}

origin: greenrobot/essentials

@Override
public void reset() {
  checksum.reset();
}
origin: apache/flume

protected long calculateChecksum(byte[] body) {
 checksum.reset();
 checksum.update(body, 0, body.length);
 return checksum.getValue();
}
origin: apache/ignite

/**
 * Resets this to an empty file.
 */
public void reset() {
  currBuf = 0;
  currBufIdx = -1;
  bufPosition = 0;
  bufStart = 0;
  bufLength = 0;
  file.setLength(0);
  crc.reset();
}
origin: org.apache.lucene/lucene-core

/** Resets this to an empty file. */
public void reset() {
 currentBuffer = null;
 currentBufferIndex = -1;
 bufferPosition = 0;
 bufferStart = 0;
 bufferLength = 0;
 file.setLength(0);
 if (crc != null) {
  crc.reset();
 }
}
origin: greenrobot/essentials

private long getHash(ByteBuffer byteBuffer) {
  byte[] bytes = byteBuffer.array();
  checksum.reset();
  checksum.update(bytes, 0, bytes.length);
  long value = checksum.getValue();
  checksum.reset();
  return value;
}
origin: commons-codec/commons-codec

 @Override
 public void run() {
  final long st = System.nanoTime();
  crc.reset();
  for (int i = 0; i < trials; i++) {
   crc.update(bytes, 0, size);
  }
  final long et = System.nanoTime();
  final double secsElapsed = (et - st) / 1000000000.0d;
  results[index] = new BenchResult(crc.getValue(), mbProcessed/secsElapsed);
 }
};
origin: greenrobot/essentials

@Before
public void setUp() {
  checksum.reset();
}
origin: greenrobot/essentials

@Test
public void testMixedUnaligned() {
  checksum.update(INPUT16, 0, INPUT16.length);
  long hash = checksum.getValue();
  checksum.reset();
  checksum.update(INPUT16, 0, 2);
  checksum.update(INPUT16[2]);
  checksum.update(INPUT16, 3, 11);
  checksum.update(INPUT16[14]);
  checksum.update(INPUT16[15]);
  Assert.assertEquals(hash, checksum.getValue());
}
origin: greenrobot/essentials

@Test
public void testRestUnaligned() {
  checksum.update(42);
  long hash = checksum.getValue();
  checksum.reset();
  checksum.update(42);
  Assert.assertEquals(hash, checksum.getValue());
}
origin: greenrobot/essentials

@Test
public void testExpectedHashVariableOffset() {
  byte[] bytes = new byte[512];
  new Random(31).nextBytes(bytes);
  for (int i = 0; i <= bytes.length; i++) {
    int expected = MurmurHash3Yonik.murmurhash3_x86_32(bytes, i, bytes.length - i, 0);
    checksum.reset();
    checksum.update(bytes, i, bytes.length - i);
    int value = (int) checksum.getValue();
    Assert.assertEquals(expected, value);
  }
}
origin: greenrobot/essentials

@Test
public void testFnv32UpdateBytesZeroHash() {
  checksum.update(INPUT32_ZERO1, 0, INPUT32_ZERO1.length);
  Assert.assertEquals(0, checksum.getValue());
  checksum.reset();
  checksum.update(INPUT32_ZERO2, 0, INPUT32_ZERO1.length);
  Assert.assertEquals(0, checksum.getValue());
}
origin: greenrobot/essentials

@Test
public void testExpectedHashVariableLength() {
  byte[] bytes = new byte[512];
  new Random(23).nextBytes(bytes);
  for (int i = 0; i <= bytes.length; i++) {
    int expected = MurmurHash3Yonik.murmurhash3_x86_32(bytes, 0, i, 0);
    checksum.reset();
    checksum.update(bytes, 0, i);
    int value = (int) checksum.getValue();
    Assert.assertEquals(expected, value);
  }
}
origin: greenrobot/essentials

@Test
public void testFnv32UpdateZeroHash() {
  for (int b : INPUT32_ZERO1) {
    checksum.update(b);
  }
  Assert.assertEquals(0, checksum.getValue());
  checksum.reset();
  for (int b : INPUT32_ZERO2) {
    checksum.update(b);
  }
  Assert.assertEquals(0, checksum.getValue());
}
origin: greenrobot/essentials

@Test
public void testBasics() {
  long initialHash = checksum.getValue();
  for (int b : INPUT4) {
    checksum.update(b);
    Assert.assertNotEquals(initialHash, checksum.getValue());
  }
  long hash = checksum.getValue();
  checksum.reset();
  Assert.assertEquals(initialHash, checksum.getValue());
  checksum.update(INPUT4, 0, INPUT4.length);
  Assert.assertEquals(hash, checksum.getValue());
}
java.util.zipChecksumreset

Javadoc

Resets the checksum value applied before beginning calculations on a new stream of data.

Popular methods of Checksum

  • getValue
    Returns the current calculated checksum value.
  • update
    Updates the checksum with the given bytes.

Popular in Java

  • Reactive rest calls using spring rest template
  • compareTo (BigDecimal)
  • setRequestProperty (URLConnection)
  • scheduleAtFixedRate (Timer)
  • Proxy (java.net)
    This class represents proxy server settings. A created instance of Proxy stores a type and an addres
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Calendar (java.util)
    Calendar is an abstract base class for converting between a Date object and a set of integer fields
  • ServletException (javax.servlet)
    Defines a general exception a servlet can throw when it encounters difficulty.
  • StringUtils (org.apache.commons.lang)
    Operations on java.lang.String that arenull safe. * IsEmpty/IsBlank - checks if a String contains
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now