|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Object | +--hotline.iconlib.HLUtils
an abstract class with various useful operations, such as conversions etc.
| Constructor Summary | |
HLUtils()
|
|
| Method Summary | |
static boolean |
compareBeginStr(byte[] field,
java.lang.String c)
compare the beginning of a (Text-) bytefield with a string |
static void |
copyBytes(byte[] dest,
byte[] src,
int destOff,
int srcOff,
int len)
copies bytes from one data field into another |
static byte[] |
extractBytes(byte[] data,
int pos,
int length)
extracts a given number of bytes at a given index from a byte field |
static hotline.iconlib.HLData |
extractDataFieldHLData(byte[] data)
extracts the identity, size and offset of an icon/gif/... from the given bytefield which should be a LVT entry from a hotline.dat file |
static hotline.iconlib.HLDataHdr |
extractDataFieldHLDataHdr(byte[] data)
extracts the block name and row count from the bytefield which should have the form of a HLDataHdr table, i. e. the first 8 bytes of a LVT entry |
static int |
extractInt(byte[] data,
int pos)
extracts an integer in big endian format from a byte field at a given position |
static byte[] |
intToBytes(int val)
converts an integer to a byte field, bytes are in big endian order |
static void |
printField(byte[] field)
prints the unsigned byte values of a byte field |
static void |
printFieldInt(int[] field)
prints the int field |
static int |
signedToUnsigned(byte b)
converts a signed byte to an unsigned int |
static int |
signedToUnsigned(short s)
converts a signed short to an unsigned int |
static void |
storeReversed(byte[] dest,
byte[] src,
int destOff,
int srcOff,
int len)
copies bytes reversed from one data field into another |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public HLUtils()
| Method Detail |
public static int signedToUnsigned(byte b)
b - the byte to be converted
public static int signedToUnsigned(short s)
s - the byte to be converted
public static int extractInt(byte[] data,
int pos)
data - byte field where the integer is stored in big endian formatpos - index of the byte field where the integer starts
public static byte[] extractBytes(byte[] data,
int pos,
int length)
data - source byte fieldpos - index in datalength - number of bytes
public static hotline.iconlib.HLData extractDataFieldHLData(byte[] data)
data - byte field containing a LVT row
public static hotline.iconlib.HLDataHdr extractDataFieldHLDataHdr(byte[] data)
data - byte field containing a LVT entry
public static byte[] intToBytes(int val)
val - integer value
public static void copyBytes(byte[] dest,
byte[] src,
int destOff,
int srcOff,
int len)
dest - destination byte fieldsrc - source byte fielddestOff - offset in the destination byte fieldsrcOff - offset in the source byte fieldlen - number of bytes to be copiedstoreReversed(byte[], byte[], int, int, int)
public static void storeReversed(byte[] dest,
byte[] src,
int destOff,
int srcOff,
int len)
dest - destination byte fieldsrc - source byte fielddestOff - offset in the destination byte fieldsrcOff - offset in the source byte fieldlen - number of bytes to be copiedcopyBytes(byte[], byte[], int, int, int)public static void printField(byte[] field)
field - byte field to be printedpublic static void printFieldInt(int[] field)
field - int field to be printed
public static boolean compareBeginStr(byte[] field,
java.lang.String c)
field - byte fieldc - String
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||