org.apache.tapestry.util.io
Class BinaryDumpOutputStream

java.lang.Object
  extended by java.io.OutputStream
      extended by org.apache.tapestry.util.io.BinaryDumpOutputStream
All Implemented Interfaces:
Closeable, Flushable

public class BinaryDumpOutputStream
extends 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.

Version:
$Id: BinaryDumpOutputStream.java 243791 2004-02-19 17:38:13Z hlship $
Author:
Howard Lewis Ship

Constructor Summary
BinaryDumpOutputStream()
          Creates a PrintWriter for System.out.
BinaryDumpOutputStream(PrintWriter out)
           
BinaryDumpOutputStream(Writer out)
           
 
Method Summary
 void close()
           
 void flush()
          Forwards the flush() to the PrintWriter.
 String getAsciiBegin()
           
 String getAsciiEnd()
           
 int getBytesPerLine()
           
 String getOffsetSeperator()
           
 boolean getShowAscii()
           
 char getSubstituteChar()
           
 void setAsciiBegin(String value)
           
 void setAsciiEnd(String value)
           
 void setBytesPerLine(int value)
           
 void setOffsetSeperator(String value)
           
 void setShowAscii(boolean value)
           
 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(PrintWriter out)

BinaryDumpOutputStream

public BinaryDumpOutputStream(Writer out)
Method Detail

close

public void close()
           throws IOException
Specified by:
close in interface Closeable
Overrides:
close in class OutputStream
Throws:
IOException

flush

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

Specified by:
flush in interface Flushable
Overrides:
flush in class OutputStream
Throws:
IOException

getAsciiBegin

public String getAsciiBegin()

getAsciiEnd

public String getAsciiEnd()

getBytesPerLine

public int getBytesPerLine()

getOffsetSeperator

public String getOffsetSeperator()

getShowAscii

public boolean getShowAscii()

getSubstituteChar

public char getSubstituteChar()

setAsciiBegin

public void setAsciiBegin(String value)

setAsciiEnd

public void setAsciiEnd(String value)

setBytesPerLine

public void setBytesPerLine(int value)

setOffsetSeperator

public void setOffsetSeperator(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 IOException
Specified by:
write in class OutputStream
Throws:
IOException