|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.ecebs.rtd.enabler.common.ByteUtils
public class ByteUtils
Provides utility methods for interacting with byte arrays
Method Summary | |
---|---|
static short |
b2s(byte b)
Converts a byte into a short, ignoring sign, i.e. |
static String |
byteArrayToString(byte[] bytes)
Creates an uppercase string representation of a byte array |
static String |
byteArrayToString(byte[] bytes,
int index,
int length)
|
static String |
byteToString(byte b)
|
static byte[] |
concat(int offset,
byte[]... byteArrays)
Concatonates the provided byte arrays |
static byte[] |
concat(int offset,
Integer length,
byte[]... byteArrays)
Concatonates the provided byte arrays |
static byte[] |
concat(int offset,
Integer length,
List<byte[]> byteArrays)
Concatonates the provided byte arrays |
static byte[] |
concat(int offset,
List<byte[]> byteArrays)
Concatonates the provided byte arrays. |
static boolean |
isBitSet(int map,
int bitNum)
Checks if the specified bit number is set in the provided map |
static byte[] |
stringToByteArray(String hex)
Converts a string representation of a chain of bytes into a byte array. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
---|
public static short b2s(byte b)
b
- byte to convert
public static String byteArrayToString(byte[] bytes)
bytes
- The byte array to convert to a string
bytes == null
public static String byteToString(byte b)
public static String byteArrayToString(byte[] bytes, int index, int length)
public static byte[] stringToByteArray(String hex)
bytes
- The string of bytes to convert to a byte array
IllegalArgumentException
- if the provided hex string is invalidpublic static boolean isBitSet(int map, int bitNum)
map
- Bit map to be checkedbitNum
- Bit number to check
public static byte[] concat(int offset, byte[]... byteArrays)
offset
- byte offset to start itbyteArrays
- arrays to concatonate
concat(int, Integer, List)
public static byte[] concat(int offset, List<byte[]> byteArrays)
concat(offset, null, sectors)
offset
- byte offset to start itbyteArrays
- arrays to concatonate
concat(int, Integer, List)
public static byte[] concat(int offset, Integer length, byte[]... byteArrays)
offset
- byte offset to start itlength
- number of bytes to concatonate (can be null
to concatonate all)byteArrays
- arrays to concatonate
concat(int, Integer, List)
public static byte[] concat(int offset, Integer length, List<byte[]> byteArrays)
offset
- byte offset to start itlength
- number of bytes to concatonate (can be null
to concatonate all)byteArrays
- arrays to concatonate
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |