|
||||||||
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.io.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. |
Constructor Summary | |
HexPrintStream(java.io.OutputStream out)
Create new HexPrintStream. |
|
HexPrintStream(java.io.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 void |
main(java.lang.String[] args)
|
void |
setFormat(int format)
Change the output format. |
static java.lang.String |
toHex(byte val)
Convert a byte value into hexadecimal string representation. |
static java.lang.String |
toHex(int val)
Convert an integer value into hexadecimal string representation. |
static java.lang.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 |
equals, 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(java.io.OutputStream out)
public HexPrintStream(java.io.OutputStream out, int format)
Method Detail |
public void write(int val) throws java.io.IOException
write
in class java.io.FilterOutputStream
public void write(byte[] buf) throws java.io.IOException
write
in class java.io.FilterOutputStream
public void write(byte[] buf, int off, int len) throws java.io.IOException
write
in class java.io.FilterOutputStream
public void flush() throws java.io.IOException
flush
in class java.io.FilterOutputStream
public void close() throws java.io.IOException
close
in class java.io.FilterOutputStream
public int getFormat()
public void setFormat(int format)
public static java.lang.String toHex(int val)
val
- Integer value to convert.public static java.lang.String toHex(short val)
val
- Short value to convert.public static java.lang.String toHex(byte val)
val
- Byte value to convert.public static void main(java.lang.String[] args)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |