public class ByteFunctionHelpers extends Object
| Modifier and Type | Method and Description |
|---|---|
static int |
combineHash(int currentHash,
int newHash)
Generate a new hashCode with the given current hashCode and new hashCode.
|
static int |
compare(ArrowBuf left,
int lStart,
int lEnd,
ArrowBuf right,
int rStart,
int rEnd)
Helper function to compare a set of bytes in two ArrowBufs.
|
static int |
compare(ArrowBuf left,
int lStart,
int lEnd,
byte[] right,
int rStart,
int rEnd)
Helper function to compare a set of bytes in ArrowBuf to a ByteArray.
|
static int |
equal(ArrowBuf left,
int lStart,
int lEnd,
ArrowBuf right,
int rStart,
int rEnd)
Helper function to check for equality of bytes in two ArrowBufs.
|
static int |
hash(ArrowBuf buf,
int start,
int end)
Compute hashCode with the given
ArrowBuf and start/end index. |
static int |
unsignedIntCompare(int a,
int b) |
static int |
unsignedLongCompare(long a,
long b)
Compares the two specified
long values, treating them as unsigned values between
0 and 2^64 - 1 inclusive. |
public static final int equal(ArrowBuf left, int lStart, int lEnd, ArrowBuf right, int rStart, int rEnd)
left - Left ArrowBuf for comparisonlStart - start offset in the bufferlEnd - end offset in the bufferright - Right ArrowBuf for comparisonrStart - start offset in the bufferrEnd - end offset in the bufferpublic static final int compare(ArrowBuf left, int lStart, int lEnd, ArrowBuf right, int rStart, int rEnd)
Function will check data before completing in the case that
left - Left ArrowBuf to comparelStart - start offset in the bufferlEnd - end offset in the bufferright - Right ArrowBuf to comparerStart - start offset in the bufferrEnd - end offset in the bufferpublic static final int compare(ArrowBuf left, int lStart, int lEnd, byte[] right, int rStart, int rEnd)
left - Left ArrowBuf for comparison purposeslStart - start offset in the bufferlEnd - end offset in the bufferright - second input to be comparedrStart - start offset in the byte arrayrEnd - end offset in the byte arraypublic static int unsignedLongCompare(long a,
long b)
long values, treating them as unsigned values between
0 and 2^64 - 1 inclusive.a - the first unsigned long to compareb - the second unsigned long to comparea is less than b; a positive value if a is
greater than b; or zero if they are equalpublic static int unsignedIntCompare(int a,
int b)
public static final int hash(ArrowBuf buf, int start, int end)
ArrowBuf and start/end index.public static int combineHash(int currentHash,
int newHash)
Copyright © 2019 The Apache Software Foundation. All rights reserved.