public class BinaryUtil extends Object
| Constructor and Description |
|---|
BinaryUtil() |
| Modifier and Type | Method and Description |
|---|---|
static byte[] |
byteTo8Byte(byte a) |
static int |
compareTo(byte[] buffer1,
int offset1,
int length1,
byte[] buffer2,
int offset2,
int length2)
Lexicographically compare two arrays.
|
static long |
convertBytesToLong(byte[] bytes) |
static Long |
convertStringToLong(String a) |
static byte[] |
doubleTo8Byte(double a) |
static long |
generateChecksum(byte[] data)
Generate a checksum for a given set of bytes.
|
static byte[] |
interleaving(byte[][] buffer,
int size)
Interleaving array bytes.
|
static byte[] |
intTo8Byte(int a) |
static byte[] |
longTo8Byte(long a) |
static byte[] |
paddingTo8Byte(byte[] a) |
static byte[] |
toBytes(ByteBuffer buffer)
Copies
ByteBuffer into allocated byte[] array |
static byte[] |
toBytes(double d) |
static byte[] |
toBytes(int val) |
static byte[] |
toBytes(long val) |
static byte |
updatePos(byte a,
int apos,
byte b,
int bpos) |
static byte[] |
utf8To8Byte(String a) |
public static int compareTo(byte[] buffer1,
int offset1,
int length1,
byte[] buffer2,
int offset2,
int length2)
buffer1 - left operandbuffer2 - right operandoffset1 - Where to start comparing in the left bufferoffset2 - Where to start comparing in the right bufferlength1 - How much to compare from the left bufferlength2 - How much to compare from the right bufferpublic static byte[] paddingTo8Byte(byte[] a)
public static byte[] interleaving(byte[][] buffer,
int size)
buffer - candidate element to do interleavingpublic static byte updatePos(byte a,
int apos,
byte b,
int bpos)
public static byte[] toBytes(ByteBuffer buffer)
ByteBuffer into allocated byte[] arraypublic static byte[] toBytes(int val)
public static byte[] toBytes(long val)
public static byte[] toBytes(double d)
public static byte[] intTo8Byte(int a)
public static byte[] byteTo8Byte(byte a)
public static byte[] longTo8Byte(long a)
public static byte[] doubleTo8Byte(double a)
public static byte[] utf8To8Byte(String a)
public static long convertBytesToLong(byte[] bytes)
public static long generateChecksum(byte[] data)
Copyright © 2024 The Apache Software Foundation. All rights reserved.