|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.csss.opensource.jhexdump.JHexDumpReader
This class provides a reader that will convert an input stream into hexadecimal output. To use the class, instantiate an instance of the class, passing in the stream which you want to retreive as hexadecimal output, and then repeatedly invoke readLine() to retrieve the output. readLine() will return -1 when the end of the stream has been reached I've only tested the reader on InputStream based on either FileInputStream or... so I'm not sure of the results on input streams that may block.
Constructor Summary | |
JHexDumpReader(java.io.InputStream stream)
Constructor. |
|
JHexDumpReader(java.io.InputStream stream,
int bytesPerRow,
boolean noAscii,
boolean noPosInd)
Constructor. |
Method Summary | |
int |
getBytesPerRow()
Returns the number of bytes per line. |
boolean |
isNoAscii()
Returns the value of NoAscii. |
boolean |
isNoPosInd()
Returns the value of NoPosInd. |
int |
readLine(java.lang.StringBuffer output)
Processes a line of data from the InputStream |
void |
setBytesPerRow(int bytesPerRow)
Sets the number of bytes per line. |
void |
setNoAscii(boolean noAscii)
Sets the value of NoAscii. |
void |
setNoPosInd(boolean noPosInd)
Sets the value of NoPosInd. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public JHexDumpReader(java.io.InputStream stream)
Defaults are used for the BytesPerRow, NoAscii, and NoPosInd.
stream
- The InputStream to processpublic JHexDumpReader(java.io.InputStream stream, int bytesPerRow, boolean noAscii, boolean noPosInd)
Overides the defaults for BytesPerRow, NoAscii, and NoPosInd.
stream
- The InputStream to processbytesPerRow
- noAscii
- noPosInd
- Method Detail |
public int getBytesPerRow()
public void setBytesPerRow(int bytesPerRow)
bytesPerRow
- public boolean isNoAscii()
If set to true, the ASCII representation of the data is supressed. (defaults to false)
public void setNoAscii(boolean noAscii)
If set to true, the ASCII representation of the data is supressed. (defaults to false)
noAscii
- public boolean isNoPosInd()
If set to true, the stream position indicator is supressed. (defaults to false)
public void setNoPosInd(boolean noPosInd)
If set to true, the stream position indicator is supressed. (defaults to false)
noPosInd
- public int readLine(java.lang.StringBuffer output) throws java.io.IOException
The output will include a position indicator at the begining of the line if NoPosInd is false, and an ASCII representation of the line if NoAscii is false.
output
- The StringBuffer to return the output in
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |