com.tagtraum.sixbs
Class SIXBSWriter

java.lang.Object
  extended bycom.tagtraum.sixbs.SIXBSWriter

public class SIXBSWriter
extends java.lang.Object

Serializes beans to XML.

Version:
$Id: SIXBSWriter.java,v 1.5 2001/08/06 16:46:42 Hendrik Exp $
Author:
Hendrik Schreiber
See Also:
SIXBSReader

Field Summary
static java.lang.String vcid
          Source-Version
 
Constructor Summary
SIXBSWriter(java.io.OutputStream out, boolean append)
          Uses default char encoding.
SIXBSWriter(java.io.OutputStream out, boolean append, java.lang.String encoding)
          For performance reasons the OutputStream should be buffered.
SIXBSWriter(java.io.OutputStreamWriter out, AdapterFinder adapterFinder, boolean append)
          For performance reasons the Writer should be buffered.
SIXBSWriter(java.io.Writer out)
          For performance reasons the Writer should be buffered.
SIXBSWriter(java.io.Writer out, AdapterFinder adapterFinder, boolean append)
          For performance reasons the Writer should be buffered.
SIXBSWriter(java.io.Writer out, AdapterFinder adapterFinder, boolean append, java.lang.String encoding)
          For performance reasons the Writer should be buffered.
SIXBSWriter(java.io.Writer out, AdapterFinder adapterFinder, boolean append, java.lang.String encoding, java.lang.String version)
          For performance reasons the Writer should be buffered.
SIXBSWriter(java.io.Writer out, boolean append)
          For performance reasons the Writer should be buffered.
 
Method Summary
 void close()
          Close the stream, flushing it first.
 void flush()
          Flush the stream.
 void writeObject(java.lang.Object obj)
          Writes an object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vcid

public static java.lang.String vcid
Source-Version

Constructor Detail

SIXBSWriter

public SIXBSWriter(java.io.OutputStream out,
                   boolean append)
            throws java.io.IOException
Uses default char encoding. The default AdapterFinder is used.

Parameters:
out - OutputStream to write objects to with the system's default encoding.
append - if true, neither the XML declaration (<?xml version="1.0"?>) nor the sixbs tags are written.

SIXBSWriter

public SIXBSWriter(java.io.OutputStream out,
                   boolean append,
                   java.lang.String encoding)
            throws java.io.IOException
For performance reasons the OutputStream should be buffered. sixbs does not buffer. The default AdapterFinder is used.

Parameters:
out - OutputStream to write objects to with the system's default encoding.
append - if true, neither the XML declaration (<?xml version="1.0"?>) nor the sixbs tags are written.
encoding - char set to be used

SIXBSWriter

public SIXBSWriter(java.io.Writer out)
            throws java.io.IOException
For performance reasons the Writer should be buffered. sixbs does not buffer. sixbs will write with the systems default encoding or the encoding set in the provided buffer. No XML declaration is written. The default AdapterFinder is used. Append is set to false.

Parameters:
out - Writer to write objects to.

SIXBSWriter

public SIXBSWriter(java.io.Writer out,
                   boolean append)
            throws java.io.IOException
For performance reasons the Writer should be buffered. sixbs does not buffer. sixbs will write with the systems default encoding or the encoding set in the provided writer.

Parameters:
append - if true, neither the XML declaration (<?xml version="1.0"?>) nor the sixbs tags are written.
out - Writer to write objects to.

SIXBSWriter

public SIXBSWriter(java.io.Writer out,
                   AdapterFinder adapterFinder,
                   boolean append)
            throws java.io.IOException
For performance reasons the Writer should be buffered. sixbs does not buffer. sixbs will write with the systems default encoding or the encoding set in the provided writer.

Parameters:
out - Writer to write objects to.
append - if true, neither the XML declaration (<?xml version="1.0"?>) nor the sixbs tags are written.

SIXBSWriter

public SIXBSWriter(java.io.OutputStreamWriter out,
                   AdapterFinder adapterFinder,
                   boolean append)
            throws java.io.IOException
For performance reasons the Writer should be buffered. sixbs does not buffer. sixbs will write with the systems default encoding or the encoding set in the provided writer.

Parameters:
out - Writer to write objects to with the specified encoding.
append - if true, neither the XML declaration (<?xml version="1.0"?>) nor the sixbs tags are written.
adapterFinder - the adapterFinder to use

SIXBSWriter

public SIXBSWriter(java.io.Writer out,
                   AdapterFinder adapterFinder,
                   boolean append,
                   java.lang.String encoding)
            throws java.io.IOException
For performance reasons the Writer should be buffered. sixbs does not buffer. sixbs will write with the systems default encoding or the encoding set in the provided writer.

Parameters:
out - Writer to write objects to with the specified encoding.
append - if true, neither the XML declaration (<?xml version="1.0"?>) nor the sixbs tags are written.
adapterFinder - the adapterFinder to use
encoding - encoding that is used by the writer - set null, if unknwon

SIXBSWriter

public SIXBSWriter(java.io.Writer out,
                   AdapterFinder adapterFinder,
                   boolean append,
                   java.lang.String encoding,
                   java.lang.String version)
            throws java.io.IOException
For performance reasons the Writer should be buffered. sixbs does not buffer. sixbs will write with the systems default encoding or the encoding set in the provided writer.

Parameters:
out - Writer to write objects to with the specified encoding.
append - if true, neither the XML declaration (<?xml version="1.0"?>) nor the sixbs tags are written.
adapterFinder - the adapterFinder to use
encoding - encoding that is used by the writer - set null, if unknwon
version - version of the writerimpl that is to be instantiated
Method Detail

writeObject

public void writeObject(java.lang.Object obj)
                 throws java.io.IOException
Writes an object.

Throws:
java.io.IOException

flush

public void flush()
           throws java.io.IOException
Flush the stream. If the stream has saved any characters from the various write() methods in a buffer, write them immediately to their intended destination. Then, if that destination is another character or byte stream, flush it. Thus one flush() invocation will flush all the buffers in a chain of Writers and OutputStreams.

Throws:
java.io.IOException - If an I/O error occurs

close

public void close()
           throws java.io.IOException
Close the stream, flushing it first. Once a stream has been closed, further write() or flush() invocations will cause an IOException to be thrown. If this writer does not operate in append-mode, a closing </sixbs> tag will be written.

Throws:
java.io.IOException - If an I/O error occurs