public final class ByteArrayUtil extends Object
| Modifier and Type | Method and Description |
|---|---|
static int |
compare(byte[] a,
int astart,
byte[] b,
int bstart,
int len) |
static int |
compare(byte[] a,
int from,
int to,
byte[] b)
Compares a byte array part with an array.
|
static int |
findKey(List<byte[]> v,
int start,
byte[] key)
Find a key by means of a binary search.
|
static int |
getInt(byte[] ba,
int offset)
Returns an integer packed into a byte array.
|
static long |
getLong(byte[] ba,
int offset)
Return a long value from bytearray "ar" starting at the offset "offset".
|
static short |
getShort(byte[] ba,
int offset) |
static String |
getString(byte[] ar,
int offset,
int length)
Returns a string from the thingy.
|
static Timestamp |
getTimestamp(byte[] ar,
int offset)
Return a Timestamp value from bytearray "ar" starting at the offset "offset".
|
static void |
setInt(byte[] ba,
int offset,
int val) |
static void |
setLong(byte[] ba,
int offset,
long val)
Put a long value "val" in a byte array "ba" starting at the offset "offset"
|
static void |
setShort(byte[] ba,
int offset,
short val) |
static void |
setString(byte[] ba,
int offset,
String s,
int length)
Sets a string converted to 8-bit ascii into an array.
|
static void |
setTimestamp(byte[] ba,
int offset,
Timestamp val)
Put a Timestamp value "val" in a byte array "ba" starting at the offset "offset"
|
public static void setLong(byte[] ba,
int offset,
long val)
ba - offset - val - public static long getLong(byte[] ba,
int offset)
ar - offset - length - public static void setTimestamp(byte[] ba,
int offset,
Timestamp val)
ba - offset - val - public static Timestamp getTimestamp(byte[] ar, int offset)
ar - offset - length - public static void setShort(byte[] ba,
int offset,
short val)
public static short getShort(byte[] ba,
int offset)
public static void setInt(byte[] ba,
int offset,
int val)
public static int getInt(byte[] ba,
int offset)
public static void setString(byte[] ba,
int offset,
String s,
int length)
public static String getString(byte[] ar, int offset, int length)
public static int compare(byte[] a,
int from,
int to,
byte[] b)
public static int compare(byte[] a,
int astart,
byte[] b,
int bstart,
int len)
public static int findKey(List<byte[]> v, int start, byte[] key)
v - vector containing the element to search forstart - location where to start comparing the byteskey - The key to look for.Copyright © 2017 etc.to. All rights reserved.