|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--java.io.OutputStream
|
+--java.io.FilterOutputStream
|
+--org.openorb.util.HexPrintStream
This filter stream is used to write binary data out as formatted hex digits in one of four formats.
| Field Summary | |
static int |
FORMAT_HEXONLY
This format writes data out line by line, with breaks on word boundaries boundaries. |
static int |
FORMAT_MIXED
This format prints out the ASCII data in the left column and the corresponding hex data in the right column, with breaks on word boundaries. |
static int |
FORMAT_MIXED_TWOLINE
This format prints out ASCII chars above the hex codes. |
static int |
FORMAT_SIMPLE
Simple format. |
| Fields inherited from class java.io.FilterOutputStream |
out |
| Constructor Summary | |
HexPrintStream(OutputStream out)
Create new HexPrintStream. |
|
HexPrintStream(OutputStream out,
int format)
Create new HexPrintStream and select the format. |
|
| Method Summary | |
void |
close()
Close the stream. |
void |
flush()
Flush the stream. |
int |
getFormat()
|
static boolean |
isPrintable(byte value)
This function was defined in the Tracing class, i've moved it to here. |
static void |
main(String[] args)
|
void |
setFormat(int format)
Change the output format. |
static String |
toHex(byte val)
Convert a byte value into hexadecimal string representation. |
static String |
toHex(byte[] arr)
Convert a byte array into a printable representation. |
static String |
toHex(int val)
Convert an integer value into hexadecimal string representation. |
static String |
toHex(short val)
Convert a short value into hexadecimal string representation. |
void |
write(byte[] buf)
Write an array of bytes to the stream. |
void |
write(byte[] buf,
int off,
int len)
Write an array of bytes to the stream. |
void |
write(int val)
Write a single byte to the stream. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final int FORMAT_SIMPLE
public static final int FORMAT_HEXONLY
public static final int FORMAT_MIXED
public static final int FORMAT_MIXED_TWOLINE
| Constructor Detail |
public HexPrintStream(OutputStream out)
public HexPrintStream(OutputStream out,
int format)
| Method Detail |
public void write(int val)
throws IOException
write in class FilterOutputStream
public void write(byte[] buf)
throws IOException
write in class FilterOutputStream
public void write(byte[] buf,
int off,
int len)
throws IOException
write in class FilterOutputStream
public void flush()
throws IOException
flush in class FilterOutputStream
public void close()
throws IOException
close in class FilterOutputStreampublic int getFormat()
public void setFormat(int format)
public static String toHex(int val)
val - Integer value to convert.public static String toHex(short val)
val - Short value to convert.public static String toHex(byte val)
val - Byte value to convert.public static String toHex(byte[] arr)
arr - The array to convert.public static boolean isPrintable(byte value)
value - The byte value to check.public static void main(String[] args)
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||