com.ibm.misc
Class HexDumpEncoder
java.lang.Object
|
+--com.ibm.misc.CharacterEncoder
|
+--com.ibm.misc.HexDumpEncoder
- public class HexDumpEncoder
- extends CharacterEncoder
This class encodes a buffer into the classic: "Hexadecimal Dump" format of
the past. It is useful for analyzing the contents of binary buffers.
The format produced is as follows:
xxxx: 00 11 22 33 44 55 66 77 88 99 aa bb cc dd ee ff ................
Where xxxx is the offset into the buffer in 16 byte chunks, followed
by ascii coded hexadecimal bytes followed by the ASCII representation of
the bytes or '.' if they are not valid bytes.
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
HexDumpEncoder
public HexDumpEncoder()
bytesPerAtom
protected int bytesPerAtom()
- Description copied from class: CharacterEncoder
- Return the number of bytes per atom of encoding
- Overrides:
- bytesPerAtom in class CharacterEncoder
bytesPerLine
protected int bytesPerLine()
- Description copied from class: CharacterEncoder
- Return the number of bytes that can be encoded per line
- Overrides:
- bytesPerLine in class CharacterEncoder
encodeBufferPrefix
protected void encodeBufferPrefix(OutputStream o)
throws IOException
- Description copied from class: CharacterEncoder
- Encode the prefix for the entire buffer. By default is simply
opens the PrintStream for use by the other functions.
- Overrides:
- encodeBufferPrefix in class CharacterEncoder
encodeLinePrefix
protected void encodeLinePrefix(OutputStream o,
int len)
throws IOException
- Description copied from class: CharacterEncoder
- Encode the prefix that starts every output line.
- Overrides:
- encodeLinePrefix in class CharacterEncoder
encodeAtom
protected void encodeAtom(OutputStream o,
byte[] buf,
int off,
int len)
throws IOException
- Description copied from class: CharacterEncoder
- Encode one "atom" of information into characters.
- Overrides:
- encodeAtom in class CharacterEncoder
encodeLineSuffix
protected void encodeLineSuffix(OutputStream o)
throws IOException
- Description copied from class: CharacterEncoder
- Encode the suffix that ends every output line. By default
this method just prints a into the output stream.
- Overrides:
- encodeLineSuffix in class CharacterEncoder