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 java.lang.Object implements FastByteOperations.ByteOperations
-
-
Constructor Summary
Constructors Constructor Description UnsafeOperations()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description int
compare(byte[] buffer1, int offset1, int length1, byte[] buffer2, int offset2, int length2)
int
compare(java.nio.ByteBuffer buffer1, byte[] buffer2, int offset2, int length2)
int
compare(java.nio.ByteBuffer buffer1, int position1, int length1, byte[] buffer2, int offset2, int length2)
int
compare(java.nio.ByteBuffer buffer1, java.nio.ByteBuffer buffer2)
static int
compareTo(java.lang.Object buffer1, long memoryOffset1, int length1, java.lang.Object buffer2, long memoryOffset2, int length2)
Lexicographically compare two arrays.static int
compareTo(java.lang.Object buffer1, long offset1, int length1, java.nio.ByteBuffer buffer)
static int
compareTo(java.nio.ByteBuffer buffer1, java.nio.ByteBuffer buffer2)
void
copy(byte[] src, int srcPosition, byte[] trg, int trgPosition, int length)
void
copy(byte[] src, int srcPosition, java.nio.ByteBuffer trg, int trgPosition, int length)
static void
copy(java.lang.Object src, long srcOffset, byte[] trg, int trgPosition, int length)
static void
copy(java.lang.Object src, long srcOffset, java.lang.Object dst, long dstOffset, long length)
static void
copy(java.lang.Object src, long srcOffset, java.nio.ByteBuffer trgBuf, int trgPosition, int length)
void
copy(java.nio.ByteBuffer src, int srcPosition, byte[] trg, int trgPosition, int length)
void
copy(java.nio.ByteBuffer srcBuf, int srcPosition, java.nio.ByteBuffer trgBuf, int trgPosition, int length)
-
-
-
Method Detail
-
compare
public int compare(byte[] buffer1, int offset1, int length1, byte[] buffer2, int offset2, int length2)
- Specified by:
compare
in interfaceFastByteOperations.ByteOperations
-
compare
public int compare(java.nio.ByteBuffer buffer1, byte[] buffer2, int offset2, int length2)
- Specified by:
compare
in interfaceFastByteOperations.ByteOperations
-
compare
public int compare(java.nio.ByteBuffer buffer1, int position1, int length1, byte[] buffer2, int offset2, int length2)
- Specified by:
compare
in interfaceFastByteOperations.ByteOperations
-
compare
public int compare(java.nio.ByteBuffer buffer1, java.nio.ByteBuffer buffer2)
- Specified by:
compare
in interfaceFastByteOperations.ByteOperations
-
copy
public void copy(byte[] src, int srcPosition, byte[] trg, int trgPosition, int length)
- Specified by:
copy
in interfaceFastByteOperations.ByteOperations
-
copy
public void copy(java.nio.ByteBuffer src, int srcPosition, byte[] trg, int trgPosition, int length)
- Specified by:
copy
in interfaceFastByteOperations.ByteOperations
-
copy
public void copy(byte[] src, int srcPosition, java.nio.ByteBuffer trg, int trgPosition, int length)
- Specified by:
copy
in interfaceFastByteOperations.ByteOperations
-
copy
public void copy(java.nio.ByteBuffer srcBuf, int srcPosition, java.nio.ByteBuffer trgBuf, int trgPosition, int length)
- Specified by:
copy
in interfaceFastByteOperations.ByteOperations
-
copy
public static void copy(java.lang.Object src, long srcOffset, java.nio.ByteBuffer trgBuf, int trgPosition, int length)
-
copy
public static void copy(java.lang.Object src, long srcOffset, byte[] trg, int trgPosition, int length)
-
copy
public static void copy(java.lang.Object src, long srcOffset, java.lang.Object dst, long dstOffset, long length)
-
compareTo
@Inline public static int compareTo(java.nio.ByteBuffer buffer1, java.nio.ByteBuffer buffer2)
-
compareTo
@Inline public static int compareTo(java.lang.Object buffer1, long offset1, int length1, java.nio.ByteBuffer buffer)
-
compareTo
@Inline public static int compareTo(java.lang.Object buffer1, long memoryOffset1, int length1, java.lang.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,
< 0
if left is less than right, etc.
-
-