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

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

Best Java code snippets using org.h2.mvstore.DataUtils.parseChecksummedMap (Showing top 4 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

/**
 * Try to read a chunk footer.
 *
 * @param end the end of the chunk
 * @return the chunk, or null if not successful
 */
private Chunk readChunkFooter(long end) {
  // the following can fail for various reasons
  try {
    // read the chunk footer of the last block of the file
    ByteBuffer lastBlock = fileStore.readFully(
        end - Chunk.FOOTER_LENGTH, Chunk.FOOTER_LENGTH);
    byte[] buff = new byte[Chunk.FOOTER_LENGTH];
    lastBlock.get(buff);
    HashMap<String, String> m = DataUtils.parseChecksummedMap(buff);
    if (m != null) {
      int chunk = DataUtils.readHexInt(m, "chunk", 0);
      Chunk c = new Chunk(chunk);
      c.version = DataUtils.readHexLong(m, "version", 0);
      c.block = DataUtils.readHexLong(m, "block", 0);
      return c;
    }
  } catch (Exception e) {
    // ignore
  }
  return null;
}
origin: com.h2database/h2

HashMap<String, String> m = DataUtils.parseChecksummedMap(buff);
if (m == null) {
  continue;
origin: com.h2database/h2-mvstore

/**
 * Try to read a chunk footer.
 *
 * @param end the end of the chunk
 * @return the chunk, or null if not successful
 */
private Chunk readChunkFooter(long end) {
  // the following can fail for various reasons
  try {
    // read the chunk footer of the last block of the file
    ByteBuffer lastBlock = fileStore.readFully(
        end - Chunk.FOOTER_LENGTH, Chunk.FOOTER_LENGTH);
    byte[] buff = new byte[Chunk.FOOTER_LENGTH];
    lastBlock.get(buff);
    HashMap<String, String> m = DataUtils.parseChecksummedMap(buff);
    if (m != null) {
      int chunk = DataUtils.readHexInt(m, "chunk", 0);
      Chunk c = new Chunk(chunk);
      c.version = DataUtils.readHexLong(m, "version", 0);
      c.block = DataUtils.readHexLong(m, "block", 0);
      return c;
    }
  } catch (Exception e) {
    // ignore
  }
  return null;
}
origin: com.h2database/h2-mvstore

HashMap<String, String> m = DataUtils.parseChecksummedMap(buff);
if (m == null) {
  continue;
org.h2.mvstoreDataUtilsparseChecksummedMap

Javadoc

Parse a key-value pair list and checks its 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.
  • getFletcher32
    Calculate the Fletcher32 checksum.
  • 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.
  • getPageChunkId,
  • getPageMaxLength,
  • getPageOffset,
  • getPagePos,
  • getPageType,
  • getVarIntLen,
  • initCause,
  • newIllegalArgumentException,
  • newIllegalStateException,
  • newUnsupportedOperationException

Popular in Java

  • Reactive rest calls using spring rest template
  • setContentView (Activity)
  • getApplicationContext (Context)
  • getContentResolver (Context)
  • Table (com.google.common.collect)
    A collection that associates an ordered pair of keys, called a row key and a column key, with a sing
  • InetAddress (java.net)
    This class represents an Internet Protocol (IP) address. An IP address is either a 32-bit or 128-bit
  • Timestamp (java.sql)
    A Java representation of the SQL TIMESTAMP type. It provides the capability of representing the SQL
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
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