IcedTea-Web
NetX

net.sourceforge.jnlp.tools
Class HexDumpEncoder

java.lang.Object
  extended by net.sourceforge.jnlp.tools.CharacterEncoder
      extended by net.sourceforge.jnlp.tools.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.


Field Summary
 
Fields inherited from class net.sourceforge.jnlp.tools.CharacterEncoder
pStream
 
Constructor Summary
HexDumpEncoder()
           
 
Method Summary
protected  int bytesPerAtom()
          Return the number of bytes per atom of encoding
protected  int bytesPerLine()
          Return the number of bytes that can be encoded per line
protected  void encodeAtom(java.io.OutputStream o, byte[] buf, int off, int len)
          Encode one "atom" of information into characters.
protected  void encodeBufferPrefix(java.io.OutputStream o)
          Encode the prefix for the entire buffer.
protected  void encodeLinePrefix(java.io.OutputStream o, int len)
          Encode the prefix that starts every output line.
protected  void encodeLineSuffix(java.io.OutputStream o)
          Encode the suffix that ends every output line.
 
Methods inherited from class net.sourceforge.jnlp.tools.CharacterEncoder
encode, encode, encode, encode, encode, encodeBuffer, encodeBuffer, encodeBuffer, encodeBuffer, encodeBuffer, encodeBufferSuffix, readFully
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HexDumpEncoder

public HexDumpEncoder()
Method Detail

bytesPerAtom

protected int bytesPerAtom()
Description copied from class: CharacterEncoder
Return the number of bytes per atom of encoding

Specified by:
bytesPerAtom in class CharacterEncoder

bytesPerLine

protected int bytesPerLine()
Description copied from class: CharacterEncoder
Return the number of bytes that can be encoded per line

Specified by:
bytesPerLine in class CharacterEncoder

encodeBufferPrefix

protected void encodeBufferPrefix(java.io.OutputStream o)
                           throws java.io.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
Throws:
java.io.IOException

encodeLinePrefix

protected void encodeLinePrefix(java.io.OutputStream o,
                                int len)
                         throws java.io.IOException
Description copied from class: CharacterEncoder
Encode the prefix that starts every output line.

Overrides:
encodeLinePrefix in class CharacterEncoder
Throws:
java.io.IOException

encodeAtom

protected void encodeAtom(java.io.OutputStream o,
                          byte[] buf,
                          int off,
                          int len)
                   throws java.io.IOException
Description copied from class: CharacterEncoder
Encode one "atom" of information into characters.

Specified by:
encodeAtom in class CharacterEncoder
Throws:
java.io.IOException

encodeLineSuffix

protected void encodeLineSuffix(java.io.OutputStream o)
                         throws java.io.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
Throws:
java.io.IOException

IcedTea-Web
NetX

Submit a bug or feature