Class FastByteOperations

java.lang.Object
org.apache.cassandra.utils.FastByteOperations

public class FastByteOperations extends Object
Utility code to do optimized byte-array comparison. This is borrowed and slightly modified from Guava's UnsignedBytes class to be able to compare arrays that start at non-zero offsets.
  • Constructor Details

    • FastByteOperations

      public FastByteOperations()
  • Method Details

    • compareUnsigned

      public static int compareUnsigned(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2)
      Lexicographically compare two byte arrays.
    • compareUnsigned

      public static int compareUnsigned(ByteBuffer b1, byte[] b2, int s2, int l2)
    • compareUnsigned

      public static int compareUnsigned(byte[] b1, int s1, int l1, ByteBuffer b2)
    • compareUnsigned

      public static int compareUnsigned(ByteBuffer b1, int s1, int l1, byte[] b2, int s2, int l2)
    • compareUnsigned

      public static int compareUnsigned(byte[] b1, int s1, int l1, ByteBuffer b2, int s2, int l2)
    • compareUnsigned

      public static int compareUnsigned(ByteBuffer b1, ByteBuffer b2)
    • compareUnsigned

      public static int compareUnsigned(byte[] b1, byte[] b2)
    • copy

      public static void copy(byte[] src, int srcPosition, byte[] trg, int trgPosition, int length)
    • copy

      public static void copy(ByteBuffer src, int srcPosition, byte[] trg, int trgPosition, int length)
    • copy

      public static void copy(byte[] src, int srcPosition, ByteBuffer trg, int trgPosition, int length)
    • copy

      public static void copy(ByteBuffer src, int srcPosition, ByteBuffer trg, int trgPosition, int length)