Package org.apache.cassandra.utils
Class FastByteOperations.UnsafeOperations
java.lang.Object
org.apache.cassandra.utils.FastByteOperations.UnsafeOperations
- All Implemented Interfaces:
FastByteOperations.ByteOperations
- Enclosing class:
- FastByteOperations
public static final class FastByteOperations.UnsafeOperations
extends Object
implements FastByteOperations.ByteOperations
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcompare(byte[] buffer1, int offset1, int length1, byte[] buffer2, int offset2, int length2) intcompare(ByteBuffer buffer1, byte[] buffer2, int offset2, int length2) intcompare(ByteBuffer buffer1, int position1, int length1, byte[] buffer2, int offset2, int length2) intcompare(ByteBuffer buffer1, ByteBuffer buffer2) static intcompareTo(Object buffer1, long memoryOffset1, int length1, Object buffer2, long memoryOffset2, int length2) Lexicographically compare two arrays.static intcompareTo(Object buffer1, long offset1, int length1, ByteBuffer buffer) static intcompareTo(ByteBuffer buffer1, ByteBuffer buffer2) voidcopy(byte[] src, int srcPosition, byte[] trg, int trgPosition, int length) voidcopy(byte[] src, int srcPosition, ByteBuffer trg, int trgPosition, int length) static voidstatic voidstatic voidcopy(Object src, long srcOffset, ByteBuffer trgBuf, int trgPosition, int length) voidcopy(ByteBuffer src, int srcPosition, byte[] trg, int trgPosition, int length) voidcopy(ByteBuffer srcBuf, int srcPosition, ByteBuffer trgBuf, int trgPosition, int length)
-
Constructor Details
-
UnsafeOperations
public UnsafeOperations()
-
-
Method Details
-
compare
public int compare(byte[] buffer1, int offset1, int length1, byte[] buffer2, int offset2, int length2) - Specified by:
comparein interfaceFastByteOperations.ByteOperations
-
compare
- Specified by:
comparein interfaceFastByteOperations.ByteOperations
-
compare
public int compare(ByteBuffer buffer1, int position1, int length1, byte[] buffer2, int offset2, int length2) - Specified by:
comparein interfaceFastByteOperations.ByteOperations
-
compare
- Specified by:
comparein interfaceFastByteOperations.ByteOperations
-
copy
public void copy(byte[] src, int srcPosition, byte[] trg, int trgPosition, int length) - Specified by:
copyin interfaceFastByteOperations.ByteOperations
-
copy
- Specified by:
copyin interfaceFastByteOperations.ByteOperations
-
copy
- Specified by:
copyin interfaceFastByteOperations.ByteOperations
-
copy
public void copy(ByteBuffer srcBuf, int srcPosition, ByteBuffer trgBuf, int trgPosition, int length) - Specified by:
copyin interfaceFastByteOperations.ByteOperations
-
copy
-
copy
-
copy
-
compareTo
-
compareTo
-
compareTo
@Inline public static int compareTo(Object buffer1, long memoryOffset1, int length1, Object buffer2, long memoryOffset2, int length2) Lexicographically compare two arrays.- Parameters:
buffer1- left operand: a byte[] or nullbuffer2- right operand: a byte[] or nullmemoryOffset1- Where to start comparing in the left buffer (pure memory address if buffer1 is null, or relative otherwise)memoryOffset2- Where to start comparing in the right buffer (pure memory address if buffer1 is null, or relative otherwise)length1- How much to compare from the left bufferlength2- How much to compare from the right buffer- Returns:
- 0 if equal,
< 0if left is less than right, etc.
-