java.lang.Objectjavax.baja.nre.util.ByteArrayUtil
Byte array utilities.
| Constructor Summary | |
ByteArrayUtil()
|
|
| Method Summary | |
static byte[] |
clone(byte[] a)
Create a copy of the specified byte array. |
static void |
copy(byte[] source,
byte[] target)
Copy the contents of the source byte array into the target byte array. |
static boolean |
equals(byte[] a1,
byte[] a2)
Return true if the two specified byte arrays have equal lengths and contents. |
static void |
hexDump(byte[] b)
Dump a byte array to standard out. |
static void |
hexDump(byte[] b,
int offset,
int length)
Dump a slice of a byte array to standard out. |
static void |
hexDump(java.io.PrintWriter out,
byte[] b,
int offset,
int length)
Dump a byte array to the given print writer. |
static void |
hexDump(java.lang.String linePrefix,
byte[] b)
|
static void |
hexDump(java.lang.String linePrefix,
byte[] b,
int offset,
int length)
|
static void |
hexDump(java.lang.String linePrefix,
java.io.PrintWriter out,
byte[] b,
int offset,
int length)
|
static byte[] |
hexStringToBytes(java.lang.String hex)
Convert a hex string into the equivalent byte array. |
static void |
memset(byte[] buf,
byte value)
|
static int |
readInt(byte[] buf,
int offset)
Read a 4 byte integer from the byte array at the given offset using network byte ordering. |
static long |
readLong(byte[] buf,
int offset)
Read a 8 byte long from the byte array at the given offset using network byte ordering. |
static short |
readShort(byte[] buf,
int offset)
Read an signed short from the byte array at the given offset using network byte ordering. |
static int |
readUnsignedByte(byte[] buf,
int offset)
Read an unsigned byte from the byte array at the given offset. |
static int |
readUnsignedShort(byte[] buf,
int offset)
Read an unsigned short from the byte array at the given offset using network byte ordering. |
static java.lang.String |
toHexString(byte[] b)
Convenience for toHexString(b, 0, b.length). |
static java.lang.String |
toHexString(byte[] b,
int off,
int len)
Return the byte array as a hex string. |
static java.lang.String |
toHexString(byte[] b,
int off,
int len,
java.lang.String delimiter)
|
static java.lang.String |
toHexString(byte[] b,
java.lang.String delimiter)
|
static int |
writeByte(byte[] buf,
int offset,
int value)
Write the specified byte into the byte array at the give offset. |
static int |
writeInt(byte[] buf,
int offset,
int value)
Write the 4 bytes at the specified offset with the given integer value. |
static int |
writeLong(byte[] buf,
int offset,
long value)
Write the 8 bytes at the specified offset with the given long value. |
static int |
writeShort(byte[] buf,
int offset,
int value)
Write the 2 bytes at specified offset with the given short value. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public ByteArrayUtil()
| Method Detail |
public static byte[] clone(byte[] a)
public static void copy(byte[] source,
byte[] target)
ArrayIndexOutOfBounds - if the target
array is not as big or bigger than the
source array.
public static boolean equals(byte[] a1,
byte[] a2)
public static void memset(byte[] buf,
byte value)
public static int readUnsignedByte(byte[] buf,
int offset)
public static short readShort(byte[] buf,
int offset)
public static int readUnsignedShort(byte[] buf,
int offset)
public static int readInt(byte[] buf,
int offset)
public static long readLong(byte[] buf,
int offset)
public static int writeByte(byte[] buf,
int offset,
int value)
public static int writeShort(byte[] buf,
int offset,
int value)
public static int writeInt(byte[] buf,
int offset,
int value)
public static int writeLong(byte[] buf,
int offset,
long value)
public static java.lang.String toHexString(byte[] b)
toHexString(b, 0, b.length).
public static java.lang.String toHexString(byte[] b,
java.lang.String delimiter)
public static java.lang.String toHexString(byte[] b,
int off,
int len)
public static java.lang.String toHexString(byte[] b,
int off,
int len,
java.lang.String delimiter)
public static byte[] hexStringToBytes(java.lang.String hex)
public static void hexDump(byte[] b)
public static void hexDump(java.lang.String linePrefix,
byte[] b)
public static void hexDump(byte[] b,
int offset,
int length)
public static void hexDump(java.lang.String linePrefix,
byte[] b,
int offset,
int length)
public static void hexDump(java.io.PrintWriter out,
byte[] b,
int offset,
int length)
public static void hexDump(java.lang.String linePrefix,
java.io.PrintWriter out,
byte[] b,
int offset,
int length)
Copyright © 2000-2016 Tridium Inc. All rights reserved.