Tabnine Logo
ChunkIndex$Offset2
Code IndexAdd Tabnine to your IDE (free)

How to use
ChunkIndex$Offset2
in
org.eclipse.jgit.storage.dht

Best Java code snippets using org.eclipse.jgit.storage.dht.ChunkIndex$Offset2 (Showing top 2 results out of 315)

origin: org.eclipse.jgit/org.eclipse.jgit.storage.dht

static ChunkIndex fromBytes(ChunkKey key, byte[] index, int ptr, int len)
    throws DhtException {
  int v = index[ptr] & 0xff;
  switch (v) {
  case V1: {
    final int offsetFormat = index[ptr + 1] & 7;
    switch (offsetFormat) {
    case 1:
      return new Offset1(index, ptr, len, key);
    case 2:
      return new Offset2(index, ptr, len, key);
    case 3:
      return new Offset3(index, ptr, len, key);
    case 4:
      return new Offset4(index, ptr, len, key);
    default:
      throw new DhtException(MessageFormat.format(
          DhtText.get().unsupportedChunkIndex,
          Integer.toHexString(NB.decodeUInt16(index, ptr)), key));
    }
  }
  default:
    throw new DhtException(MessageFormat.format(
        DhtText.get().unsupportedChunkIndex,
        Integer.toHexString(v), key));
  }
}
origin: com.madgag/org.eclipse.jgit.storage.dht

static ChunkIndex fromBytes(ChunkKey key, byte[] index, int ptr, int len)
    throws DhtException {
  int v = index[ptr] & 0xff;
  switch (v) {
  case V1: {
    final int offsetFormat = index[ptr + 1] & 7;
    switch (offsetFormat) {
    case 1:
      return new Offset1(index, ptr, len, key);
    case 2:
      return new Offset2(index, ptr, len, key);
    case 3:
      return new Offset3(index, ptr, len, key);
    case 4:
      return new Offset4(index, ptr, len, key);
    default:
      throw new DhtException(MessageFormat.format(
          DhtText.get().unsupportedChunkIndex,
          Integer.toHexString(NB.decodeUInt16(index, ptr)), key));
    }
  }
  default:
    throw new DhtException(MessageFormat.format(
        DhtText.get().unsupportedChunkIndex,
        Integer.toHexString(v), key));
  }
}
org.eclipse.jgit.storage.dhtChunkIndex$Offset2

Most used methods

  • <init>

Popular in Java

  • Creating JSON documents from java classes using gson
  • setContentView (Activity)
  • compareTo (BigDecimal)
  • startActivity (Activity)
  • FlowLayout (java.awt)
    A flow layout arranges components in a left-to-right flow, much like lines of text in a paragraph. F
  • PrintStream (java.io)
    Fake signature of an existing Java class.
  • NoSuchElementException (java.util)
    Thrown when trying to retrieve an element past the end of an Enumeration or Iterator.
  • TreeMap (java.util)
    Walk the nodes of the tree left-to-right or right-to-left. Note that in descending iterations, next
  • Pattern (java.util.regex)
    Patterns are compiled regular expressions. In many cases, convenience methods such as String#matches
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Github Copilot alternatives
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