|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.resoa.util.ByteBufferUtils
public class ByteBufferUtils
Helper functions for conversion of unsigned bytes to integer
| Constructor Summary | |
|---|---|
ByteBufferUtils()
|
|
| Method Summary | |
|---|---|
static byte[] |
fromByteArrayString(java.lang.String source)
Converts a HEX string to byte array |
static byte[] |
fromByteArrayString(java.lang.String source,
java.lang.String delimiter)
create a byte array from string. unspecific data is set to null |
static int |
IntFromUnsignedByte(byte b)
convert a unsigned byte into integer value |
static java.lang.String |
toHexString(byte b)
converts a single byte to HEX format (lower case) |
static java.lang.String |
toHexString(byte[] byteArray)
represent byte[] array as HEX string |
static java.lang.String |
toHexString(byte[] buf,
int offset,
int length)
represent a part of byte[] array as string |
static java.lang.String |
toHexString(byte[] data,
java.lang.String delimiter,
boolean toUpperCase)
Returns a HEX string of a byte array |
static java.lang.String |
toHexString(java.nio.ByteBuffer buffer)
Creates a HEX String from ByteBuffer array |
static byte |
UnsignedByteFromInt(int i)
convert integer to byte in optimistic way, in case of outside value 0..255 it returns 0 |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ByteBufferUtils()
| Method Detail |
|---|
public static byte UnsignedByteFromInt(int i)
i - the integer byte value to convert
public static int IntFromUnsignedByte(byte b)
b - the byte value
public static java.lang.String toHexString(java.nio.ByteBuffer buffer)
buffer - the ByteBuffer
public static java.lang.String toHexString(byte[] byteArray)
byteArray - the bytes
public static java.lang.String toHexString(byte[] buf,
int offset,
int length)
buf - offset - length -
public static java.lang.String toHexString(byte[] data,
java.lang.String delimiter,
boolean toUpperCase)
data - the arraydelimiter - the delimiter, set between each HEX bytetoUpperCase - true if converted to UpperCase
public static java.lang.String toHexString(byte b)
b - the byte
public static byte[] fromByteArrayString(java.lang.String source)
source - the HEX based representation
public static byte[] fromByteArrayString(java.lang.String source,
java.lang.String delimiter)
source - the source stringdelimiter - the delimiter in source
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||