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

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

Best Java code snippets using org.h2.mvstore.DataUtils.encodeLength (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

/**
 * Get the position of this page. The following information is encoded in
 * the position: the chunk id, the offset, the maximum length, and the type
 * (node or leaf).
 *
 * @param chunkId the chunk id
 * @param offset the offset
 * @param length the length
 * @param type the page type (1 for node, 0 for leaf)
 * @return the position
 */
public static long getPagePos(int chunkId, int offset,
    int length, int type) {
  long pos = (long) chunkId << 38;
  pos |= (long) offset << 6;
  pos |= encodeLength(length) << 1;
  pos |= type;
  return pos;
}
origin: org.wowtools/h2

/**
 * Get the position of this page. The following information is encoded in
 * the position: the chunk id, the offset, the maximum length, and the type
 * (node or leaf).
 *
 * @param chunkId the chunk id
 * @param offset the offset
 * @param length the length
 * @param type the page type (1 for node, 0 for leaf)
 * @return the position
 */
public static long getPagePos(int chunkId, int offset,
    int length, int type) {
  long pos = (long) chunkId << 38;
  pos |= (long) offset << 6;
  pos |= encodeLength(length) << 1;
  pos |= type;
  return pos;
}
origin: com.eventsourcing/h2

/**
 * Get the position of this page. The following information is encoded in
 * the position: the chunk id, the offset, the maximum length, and the type
 * (node or leaf).
 *
 * @param chunkId the chunk id
 * @param offset the offset
 * @param length the length
 * @param type the page type (1 for node, 0 for leaf)
 * @return the position
 */
public static long getPagePos(int chunkId, int offset,
    int length, int type) {
  long pos = (long) chunkId << 38;
  pos |= (long) offset << 6;
  pos |= encodeLength(length) << 1;
  pos |= type;
  return pos;
}
origin: com.h2database/h2-mvstore

/**
 * Get the position of this page. The following information is encoded in
 * the position: the chunk id, the offset, the maximum length, and the type
 * (node or leaf).
 *
 * @param chunkId the chunk id
 * @param offset the offset
 * @param length the length
 * @param type the page type (1 for node, 0 for leaf)
 * @return the position
 */
public static long getPagePos(int chunkId, int offset,
    int length, int type) {
  long pos = (long) chunkId << 38;
  pos |= (long) offset << 6;
  pos |= encodeLength(length) << 1;
  pos |= type;
  return pos;
}
org.h2.mvstoreDataUtilsencodeLength

Javadoc

Convert the length to a length code 0..31. 31 means more than 1 MB.

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.
  • 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.
  • getPageOffset
    Get the offset from the position.
  • getPageMaxLength,
  • getPageOffset,
  • getPagePos,
  • getPageType,
  • getVarIntLen,
  • initCause,
  • newIllegalArgumentException,
  • newIllegalStateException,
  • newUnsupportedOperationException

Popular in Java

  • Running tasks concurrently on multiple threads
  • runOnUiThread (Activity)
  • getContentResolver (Context)
  • orElseThrow (Optional)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • Socket (java.net)
    Provides a client-side TCP socket.
  • UUID (java.util)
    UUID is an immutable representation of a 128-bit universally unique identifier (UUID). There are mul
  • Semaphore (java.util.concurrent)
    A counting semaphore. Conceptually, a semaphore maintains a set of permits. Each #acquire blocks if
  • JFrame (javax.swing)
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