Package org.apache.cassandra.utils
Class FastByteOperations
java.lang.Object
org.apache.cassandra.utils.FastByteOperations
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.-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic interfacestatic final classstatic final class -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic intcompareUnsigned(byte[] b1, byte[] b2) static intcompareUnsigned(byte[] b1, int s1, int l1, byte[] b2, int s2, int l2) Lexicographically compare two byte arrays.static intcompareUnsigned(byte[] b1, int s1, int l1, ByteBuffer b2) static intcompareUnsigned(byte[] b1, int s1, int l1, ByteBuffer b2, int s2, int l2) static intcompareUnsigned(ByteBuffer b1, byte[] b2, int s2, int l2) static intcompareUnsigned(ByteBuffer b1, int s1, int l1, byte[] b2, int s2, int l2) static intcompareUnsigned(ByteBuffer b1, ByteBuffer b2) static voidcopy(byte[] src, int srcPosition, byte[] trg, int trgPosition, int length) static voidcopy(byte[] src, int srcPosition, ByteBuffer trg, int trgPosition, int length) static voidcopy(ByteBuffer src, int srcPosition, byte[] trg, int trgPosition, int length) static voidcopy(ByteBuffer src, int srcPosition, ByteBuffer trg, int trgPosition, int length)
-
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
-
compareUnsigned
-
compareUnsigned
-
compareUnsigned
-
compareUnsigned
-
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
-
copy
-
copy
public static void copy(ByteBuffer src, int srcPosition, ByteBuffer trg, int trgPosition, int length)
-