org.apache.tapestry.util.io
Class BinaryDumpOutputStream

java.lang.Object
  extended byjava.io.OutputStream
      extended byorg.apache.tapestry.util.io.BinaryDumpOutputStream

public class BinaryDumpOutputStream
extends java.io.OutputStream

A kind of super-formatter. It is sent a stream of binary data and formats it in a human-readable dump format which is forwarded to its output stream.

Currently, output is in hex though options to change that may be introduced.

Author:
Howard Lewis Ship

Constructor Summary
BinaryDumpOutputStream()
          Creates a PrintWriter for System.out.
BinaryDumpOutputStream(java.io.PrintWriter out)
           
BinaryDumpOutputStream(java.io.Writer out)
           
 
Method Summary
 void close()
           
 void flush()
          Forwards the flush() to the PrintWriter.
 java.lang.String getAsciiBegin()
           
 java.lang.String getAsciiEnd()
           
 int getBytesPerLine()
           
 java.lang.String getOffsetSeperator()
           
 boolean getShowAscii()
           
 int getSpacingInterval()
           
 char getSubstituteChar()
           
 boolean isShowOffset()
           
 void setAsciiBegin(java.lang.String value)
           
 void setAsciiEnd(java.lang.String value)
           
 void setBytesPerLine(int value)
           
 void setOffsetSeperator(java.lang.String value)
           
 void setShowAscii(boolean value)
           
 void setShowOffset(boolean showOffset)
           
 void setSpacingInterval(int spacingInterval)
           
 void setSubstituteChar(char value)
          Sets the character used in the ASCII dump that substitutes for characters outside the range of 32..126.
 void write(int b)
           
 
Methods inherited from class java.io.OutputStream
write, write
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

BinaryDumpOutputStream

public BinaryDumpOutputStream()
Creates a PrintWriter for System.out.


BinaryDumpOutputStream

public BinaryDumpOutputStream(java.io.PrintWriter out)

BinaryDumpOutputStream

public BinaryDumpOutputStream(java.io.Writer out)
Method Detail

close

public void close()
           throws java.io.IOException
Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Forwards the flush() to the PrintWriter.

Throws:
java.io.IOException

getAsciiBegin

public java.lang.String getAsciiBegin()

getAsciiEnd

public java.lang.String getAsciiEnd()

getBytesPerLine

public int getBytesPerLine()

getOffsetSeperator

public java.lang.String getOffsetSeperator()

getShowAscii

public boolean getShowAscii()

getSubstituteChar

public char getSubstituteChar()

setAsciiBegin

public void setAsciiBegin(java.lang.String value)

setAsciiEnd

public void setAsciiEnd(java.lang.String value)

setBytesPerLine

public void setBytesPerLine(int value)

setOffsetSeperator

public void setOffsetSeperator(java.lang.String value)

setShowAscii

public void setShowAscii(boolean value)

setSubstituteChar

public void setSubstituteChar(char value)
Sets the character used in the ASCII dump that substitutes for characters outside the range of 32..126.


write

public void write(int b)
           throws java.io.IOException
Throws:
java.io.IOException

setSpacingInterval

public void setSpacingInterval(int spacingInterval)

isShowOffset

public boolean isShowOffset()

setShowOffset

public void setShowOffset(boolean showOffset)

getSpacingInterval

public int getSpacingInterval()