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,
byte[] right,
int rStart,
int rEnd)
Helper function to compare a set of bytes in ArrowBuf to a ByteArray.
|
static int |
compare(ArrowBuf left,
long lStart,
long lEnd,
ArrowBuf right,
long rStart,
long rEnd)
Helper function to compare a set of bytes in two ArrowBufs.
|
static int |
equal(ArrowBuf left,
long lStart,
long lEnd,
ArrowBuf right,
long rStart,
long rEnd)
Helper function to check for equality of bytes in two ArrowBufs.
|
static int |
hash(ArrowBufHasher hasher,
ArrowBuf buf,
long start,
long end)
Compute hashCode with the given
ArrowBufHasher , ArrowBuf and start/end index. |
static int |
hash(ArrowBuf buf,
long start,
long 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 int equal(ArrowBuf left, long lStart, long lEnd, ArrowBuf right, long rStart, long 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 int compare(ArrowBuf left, long lStart, long lEnd, ArrowBuf right, long rStart, long 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 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 int hash(ArrowBuf buf, long start, long end)
ArrowBuf
and start/end index.public static final int hash(ArrowBufHasher hasher, ArrowBuf buf, long start, long end)
ArrowBufHasher
, ArrowBuf
and start/end index.public static int combineHash(int currentHash, int newHash)
Copyright © 2023 The Apache Software Foundation. All rights reserved.