|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.legstar.coxb.host.HostData
public class HostData
Represents a generic host data content. Mainly a wrapper over a byte array.
Constructor Summary | |
---|---|
HostData(byte[] hostData)
Contructor from existing host data. |
|
HostData(String hexString)
Contructor from a hexadecimal String. |
Method Summary | |
---|---|
byte[] |
getHostData()
|
int |
length()
|
static byte[] |
toByteArray(String string)
Helper method to populate a byte array from a hex string representation. |
String |
toHexString()
Helper method to dump field content in hexadecimal. |
static String |
toHexString(byte[] hostBytes)
Helper method to dump field content in hexadecimal. |
static String |
toHexString(byte[] hostBytes,
int maxBytes)
Another pretty printing method but with a limit to the number of bytes printed. |
static String |
toHexString(byte[] hostBytes,
int start,
int length)
Helper method to dump field content in hexadecimal. |
static String |
toHexString(byte[] hostBytes,
int start,
int length,
int maxBytes)
Another pretty printing method but with a limit to the number of bytes printed. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HostData(byte[] hostData)
hostData
- byte array representing host field contentpublic HostData(String hexString)
hexString
- A string of hex representationsMethod Detail |
---|
public String toHexString()
public static String toHexString(byte[] hostBytes)
hostBytes
- a byte array to get hexadecimal representation for
public static String toHexString(byte[] hostBytes, int start, int length)
hostBytes
- a byte array to get hexadecimal representation forstart
- 0-based position of first byte to dumplength
- number of bytes to dump
public static String toHexString(byte[] hostBytes, int maxBytes)
hostBytes
- byte array to printmaxBytes
- maximum number of bytes to process
public static String toHexString(byte[] hostBytes, int start, int length, int maxBytes)
hostBytes
- byte array to printstart
- 0-based position of first byte to dumplength
- total number of bytes to dumpmaxBytes
- maximum number of bytes to process
public static byte[] toByteArray(String string)
string
- a string of hexadecimal characters to be turned
into a byte array
public byte[] getHostData()
public int length()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |