|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.openjena.atlas.lib.Bytes
public class Bytes
Byte-oriented operations. Packing and unpacking integers is in network order (Big endian - which is the preferred order in Java) "http://en.wikipedia.org/wiki/Endianness"
| Field Summary | |
|---|---|
static byte[] |
hexDigitsLC
|
static byte[] |
hexDigitsUC
|
| Method Summary | |
|---|---|
static java.lang.String |
asHex(byte[] bytes)
Return a hex string representing the bytes, zero padded to length of byte array. |
static java.lang.String |
asHex(byte[] bytes,
int start,
int finish,
char[] hexDigits)
|
static java.lang.String |
asHexLC(byte[] bytes)
|
static java.lang.String |
asHexUC(byte[] bytes)
|
static java.lang.String |
bytes2string(byte[] x)
Return the string for some UTF-8 bytes |
static int |
compare(byte[] x1,
byte[] x2)
Compare two byte arrays which may be of different lengths |
static int |
compareByte(byte b1,
byte b2)
|
static byte[] |
copyOf(byte[] bytes)
|
static byte[] |
copyOf(byte[] bytes,
int start)
|
static byte[] |
copyOf(byte[] bytes,
int start,
int length)
|
static java.lang.String |
fromByteBuffer(java.nio.ByteBuffer bb)
Decode a string into a ByteBuffer |
static java.lang.String |
fromByteBuffer(java.nio.ByteBuffer bb,
java.nio.charset.CharsetDecoder dec)
Decode a string into a ByteBuffer |
static int |
getInt(byte[] b)
Get an int from a byte array (network order) |
static int |
getInt(byte[] b,
int idx)
Get an int from a byte array (network order) |
static long |
getLong(byte[] b)
Get a long from a byte array (network order) |
static long |
getLong(byte[] b,
int idx)
Get a long from a byte array (network order) |
static int |
hexCharToInt(char c)
|
static void |
main(java.lang.String... args)
|
static byte[] |
packInt(int val)
int to byte array |
static byte[] |
packLong(long val)
long to byte array |
static void |
setInt(int value,
byte[] b)
Put an int into a byte array |
static void |
setInt(int x,
byte[] b,
int idx)
Put an int into a byte array from a given position |
static void |
setLong(long value,
byte[] b)
Put a long into a byte array |
static void |
setLong(long value,
byte[] b,
int idx)
Put a long into a byte array from a given position |
static byte[] |
string2bytes(java.lang.String x)
Return the UTF-8 bytes for a string |
static int |
toByteBuffer(java.lang.CharSequence s,
java.nio.ByteBuffer bb)
Encode a string into a ByteBuffer : on return position is the end of the encoding |
static int |
toByteBuffer(java.lang.CharSequence s,
java.nio.ByteBuffer bb,
java.nio.charset.CharsetEncoder enc)
Encode a string into a ByteBuffer : on return position is the end of the encoding |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final byte[] hexDigitsUC
public static final byte[] hexDigitsLC
| Method Detail |
|---|
public static void main(java.lang.String... args)
public static int compare(byte[] x1,
byte[] x2)
public static int compareByte(byte b1,
byte b2)
public static byte[] copyOf(byte[] bytes)
public static byte[] copyOf(byte[] bytes,
int start)
public static byte[] copyOf(byte[] bytes,
int start,
int length)
public static final int getInt(byte[] b)
b - Byte Array
public static final int getInt(byte[] b,
int idx)
b - Byte Arrayidx - Starting point of bytespublic static final long getLong(byte[] b)
b - Byte Array
public static final long getLong(byte[] b,
int idx)
b - Byte Arrayidx - Starting point of bytes
public static final void setInt(int value,
byte[] b)
value - The integerb - byte array
public static final void setInt(int x,
byte[] b,
int idx)
x - The integerb - byte arrayidx - starting point
public static final void setLong(long value,
byte[] b)
value - The integerb - byte array
public static final void setLong(long value,
byte[] b,
int idx)
value - The integerb - byte arrayidx - starting pointpublic static byte[] packInt(int val)
public static byte[] packLong(long val)
public static byte[] string2bytes(java.lang.String x)
public static java.lang.String bytes2string(byte[] x)
public static int toByteBuffer(java.lang.CharSequence s,
java.nio.ByteBuffer bb)
public static int toByteBuffer(java.lang.CharSequence s,
java.nio.ByteBuffer bb,
java.nio.charset.CharsetEncoder enc)
public static java.lang.String fromByteBuffer(java.nio.ByteBuffer bb)
public static java.lang.String fromByteBuffer(java.nio.ByteBuffer bb,
java.nio.charset.CharsetDecoder dec)
public static java.lang.String asHex(byte[] bytes)
public static java.lang.String asHexUC(byte[] bytes)
public static java.lang.String asHexLC(byte[] bytes)
public static java.lang.String asHex(byte[] bytes,
int start,
int finish,
char[] hexDigits)
public static int hexCharToInt(char c)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||