Codota Logo
DataUtils.getFletcher32
Code IndexAdd Codota to your IDE (free)

How to use
getFletcher32
method
in
org.h2.mvstore.DataUtils

Best Java code snippets using org.h2.mvstore.DataUtils.getFletcher32 (Showing top 14 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
StringBuilder s =
  • Codota Iconnew StringBuilder()
  • Codota Iconnew StringBuilder(32)
  • Codota IconString str;new StringBuilder(str)
  • Smart code suggestions by Codota
}
origin: com.h2database/h2

private void writeStoreHeader() {
  StringBuilder buff = new StringBuilder(112);
  if (lastChunk != null) {
    storeHeader.put("block", lastChunk.block);
    storeHeader.put("chunk", lastChunk.id);
    storeHeader.put("version", lastChunk.version);
  }
  DataUtils.appendMap(buff, storeHeader);
  byte[] bytes = buff.toString().getBytes(StandardCharsets.ISO_8859_1);
  int checksum = DataUtils.getFletcher32(bytes, 0, bytes.length);
  DataUtils.appendMap(buff, "fletcher", checksum);
  buff.append('\n');
  bytes = buff.toString().getBytes(StandardCharsets.ISO_8859_1);
  ByteBuffer header = ByteBuffer.allocate(2 * BLOCK_SIZE);
  header.put(bytes);
  header.position(BLOCK_SIZE);
  header.put(bytes);
  header.rewind();
  write(0, header);
}
origin: com.h2database/h2

byte[] getFooterBytes() {
  StringBuilder buff = new StringBuilder(FOOTER_LENGTH);
  DataUtils.appendMap(buff, "chunk", id);
  DataUtils.appendMap(buff, "block", block);
  DataUtils.appendMap(buff, "version", version);
  byte[] bytes = buff.toString().getBytes(StandardCharsets.ISO_8859_1);
  int checksum = DataUtils.getFletcher32(bytes, 0, bytes.length);
  DataUtils.appendMap(buff, "fletcher", checksum);
  while (buff.length() < FOOTER_LENGTH - 1) {
    buff.append(' ');
  }
  buff.append('\n');
  return buff.toString().getBytes(StandardCharsets.ISO_8859_1);
}
origin: com.h2database/h2

parseMapValue(buff, s, i + 1, size);
int check = (int) Long.parseLong(buff.toString(), 16);
if (check == getFletcher32(bytes, start, startKey - 1)) {
  return map;
origin: com.eventsourcing/h2

byte[] getFooterBytes() {
  StringBuilder buff = new StringBuilder();
  DataUtils.appendMap(buff, "chunk", id);
  DataUtils.appendMap(buff, "block", block);
  DataUtils.appendMap(buff, "version", version);
  byte[] bytes = buff.toString().getBytes(DataUtils.LATIN);
  int checksum = DataUtils.getFletcher32(bytes, bytes.length);
  DataUtils.appendMap(buff, "fletcher", checksum);
  while (buff.length() < Chunk.FOOTER_LENGTH - 1) {
    buff.append(' ');
  }
  buff.append("\n");
  return buff.toString().getBytes(DataUtils.LATIN);
}
origin: org.wowtools/h2

byte[] getFooterBytes() {
  StringBuilder buff = new StringBuilder();
  DataUtils.appendMap(buff, "chunk", id);
  DataUtils.appendMap(buff, "block", block);
  DataUtils.appendMap(buff, "version", version);
  byte[] bytes = buff.toString().getBytes(DataUtils.LATIN);
  int checksum = DataUtils.getFletcher32(bytes, bytes.length);
  DataUtils.appendMap(buff, "fletcher", checksum);
  while (buff.length() < Chunk.FOOTER_LENGTH - 1) {
    buff.append(' ');
  }
  buff.append("\n");
  return buff.toString().getBytes(DataUtils.LATIN);
}
origin: com.h2database/h2-mvstore

byte[] getFooterBytes() {
  StringBuilder buff = new StringBuilder(FOOTER_LENGTH);
  DataUtils.appendMap(buff, "chunk", id);
  DataUtils.appendMap(buff, "block", block);
  DataUtils.appendMap(buff, "version", version);
  byte[] bytes = buff.toString().getBytes(StandardCharsets.ISO_8859_1);
  int checksum = DataUtils.getFletcher32(bytes, 0, bytes.length);
  DataUtils.appendMap(buff, "fletcher", checksum);
  while (buff.length() < FOOTER_LENGTH - 1) {
    buff.append(' ');
  }
  buff.append('\n');
  return buff.toString().getBytes(StandardCharsets.ISO_8859_1);
}
origin: com.h2database/h2-mvstore

private void writeStoreHeader() {
  StringBuilder buff = new StringBuilder(112);
  if (lastChunk != null) {
    storeHeader.put("block", lastChunk.block);
    storeHeader.put("chunk", lastChunk.id);
    storeHeader.put("version", lastChunk.version);
  }
  DataUtils.appendMap(buff, storeHeader);
  byte[] bytes = buff.toString().getBytes(StandardCharsets.ISO_8859_1);
  int checksum = DataUtils.getFletcher32(bytes, 0, bytes.length);
  DataUtils.appendMap(buff, "fletcher", checksum);
  buff.append('\n');
  bytes = buff.toString().getBytes(StandardCharsets.ISO_8859_1);
  ByteBuffer header = ByteBuffer.allocate(2 * BLOCK_SIZE);
  header.put(bytes);
  header.position(BLOCK_SIZE);
  header.put(bytes);
  header.rewind();
  write(0, header);
}
origin: com.eventsourcing/h2

private void writeStoreHeader() {
  StringBuilder buff = new StringBuilder();
  if (lastChunk != null) {
    storeHeader.put("block", lastChunk.block);
    storeHeader.put("chunk", lastChunk.id);
    storeHeader.put("version", lastChunk.version);
  }
  DataUtils.appendMap(buff, storeHeader);
  byte[] bytes = buff.toString().getBytes(DataUtils.LATIN);
  int checksum = DataUtils.getFletcher32(bytes, bytes.length);
  DataUtils.appendMap(buff, "fletcher", checksum);
  buff.append("\n");
  bytes = buff.toString().getBytes(DataUtils.LATIN);
  ByteBuffer header = ByteBuffer.allocate(2 * BLOCK_SIZE);
  header.put(bytes);
  header.position(BLOCK_SIZE);
  header.put(bytes);
  header.rewind();
  write(0, header);
}
origin: org.wowtools/h2

private void writeStoreHeader() {
  StringBuilder buff = new StringBuilder();
  if (lastChunk != null) {
    storeHeader.put("block", lastChunk.block);
    storeHeader.put("chunk", lastChunk.id);
    storeHeader.put("version", lastChunk.version);
  }
  DataUtils.appendMap(buff, storeHeader);
  byte[] bytes = buff.toString().getBytes(DataUtils.LATIN);
  int checksum = DataUtils.getFletcher32(bytes, bytes.length);
  DataUtils.appendMap(buff, "fletcher", checksum);
  buff.append("\n");
  bytes = buff.toString().getBytes(DataUtils.LATIN);
  ByteBuffer header = ByteBuffer.allocate(2 * BLOCK_SIZE);
  header.put(bytes);
  header.position(BLOCK_SIZE);
  header.put(bytes);
  header.rewind();
  write(0, header);
}
origin: com.h2database/h2-mvstore

parseMapValue(buff, s, i + 1, size);
int check = (int) Long.parseLong(buff.toString(), 16);
if (check == getFletcher32(bytes, start, startKey - 1)) {
  return map;
origin: org.wowtools/h2

s = s.substring(0, s.lastIndexOf("fletcher") - 1);
byte[] bytes = s.getBytes(DataUtils.LATIN);
int checksum = DataUtils.getFletcher32(bytes, bytes.length);
if (check == checksum) {
  int chunk = DataUtils.readHexInt(m, "chunk", 0);
origin: com.eventsourcing/h2

s = s.substring(0, s.lastIndexOf("fletcher") - 1);
byte[] bytes = s.getBytes(DataUtils.LATIN);
int checksum = DataUtils.getFletcher32(bytes, bytes.length);
if (check == checksum) {
  int chunk = DataUtils.readHexInt(m, "chunk", 0);
origin: org.wowtools/h2

s = s.substring(0, s.lastIndexOf("fletcher") - 1);
byte[] bytes = s.getBytes(DataUtils.LATIN);
int checksum = DataUtils.getFletcher32(bytes,
    bytes.length);
if (check != checksum) {
origin: com.eventsourcing/h2

s = s.substring(0, s.lastIndexOf("fletcher") - 1);
byte[] bytes = s.getBytes(DataUtils.LATIN);
int checksum = DataUtils.getFletcher32(bytes,
    bytes.length);
if (check != checksum) {
org.h2.mvstoreDataUtilsgetFletcher32

Javadoc

Calculate the Fletcher32 checksum.

Popular methods of DataUtils

  • readVarInt
    Read a variable size int.
  • appendMap
    Append a map to the string builder, sorted by key.
  • checkArgument
    Throw an IllegalArgumentException if the argument is invalid.
  • copyExcept
    Copy the elements of an array, and remove one element.
  • copyWithGap
    Copy the elements of an array, with a gap.
  • encodeLength
    Convert the length to a length code 0..31. 31 means more than 1 MB.
  • formatMessage
    Format an error message.
  • getCheckValue
    Calculate a check value for the given integer. A check value is mean to verify the data is consisten
  • getErrorCode
    Get the error code from an exception message.
  • getPageChunkId
    Get the chunk id from the position.
  • getPageMaxLength
    Get the maximum length for the given code. For the code 31, PAGE_LARGE is returned.
  • getPageOffset
    Get the offset from the position.
  • getPageMaxLength,
  • getPageOffset,
  • getPagePos,
  • getPageType,
  • getVarIntLen,
  • initCause,
  • newIllegalArgumentException,
  • newIllegalStateException,
  • newUnsupportedOperationException

Popular in Java

  • Creating JSON documents from java classes using gson
  • scheduleAtFixedRate (Timer)
  • getExternalFilesDir (Context)
  • setContentView (Activity)
  • SocketTimeoutException (java.net)
    This exception is thrown when a timeout expired on a socket read or accept operation.
  • Locale (java.util)
    A Locale object represents a specific geographical, political, or cultural region. An operation that
  • ZipFile (java.util.zip)
    This class provides random read access to a zip file. You pay more to read the zip file's central di
  • ImageIO (javax.imageio)
  • BoxLayout (javax.swing)
  • BasicDataSource (org.apache.commons.dbcp)
    Basic implementation of javax.sql.DataSource that is configured via JavaBeans properties. This is no
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now