com.tagtraum.sixbs
Class SIXBSReader

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

public class SIXBSReader
extends java.lang.Object

DeSerializes beans from XML. Objects are read asynchronously therefore excellent performance is ensured. How many objects are read ahead, can be specified - you should do this, if you are intending to read many, or very large objects. Also, if speed is very important to you, you should buffer the InputStream or Reader (if this is not done by your SAX2 parser) and set readAhead to a high value.

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

Field Summary
static java.lang.String DEFAULTVERSION
           
static java.lang.String vcid
          Source-Version
 
Constructor Summary
SIXBSReader(java.io.InputStream in)
           
SIXBSReader(java.io.InputStream in, java.lang.String defaultVersion)
          Deserializes from an XML document using the given sixbs version if no version is specified in the document itself.
SIXBSReader(java.io.Reader in)
           
SIXBSReader(java.io.Reader in, java.lang.String defaultVersion)
          Deserializes from an XML document using the given sixbs version if no version is specified in the document itself.
 
Method Summary
 void close()
          Closes this reader.
protected  void finalize()
           
 java.lang.String getDefaultVersion()
          Returns the default sixbs version that should be used for parsing.
 int getReadAhead()
          Returns the number of Objects that are read in advance.
 java.lang.String getVersion()
          Returns the actually used version.
 boolean hasNext()
          Indicates whether we can read another object.
 java.lang.Object readObject()
          Starts the reading of objects.
 void setReadAhead(int readAhead)
          Sets the number of Objects which are read in advance.
 
Methods inherited from class java.lang.Object
clone, equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

vcid

public static java.lang.String vcid
Source-Version


DEFAULTVERSION

public static java.lang.String DEFAULTVERSION
Constructor Detail

SIXBSReader

public SIXBSReader(java.io.Reader in)
            throws java.io.IOException

SIXBSReader

public SIXBSReader(java.io.InputStream in)
            throws java.io.IOException

SIXBSReader

public SIXBSReader(java.io.Reader in,
                   java.lang.String defaultVersion)
            throws java.io.IOException
Deserializes from an XML document using the given sixbs version if no version is specified in the document itself.


SIXBSReader

public SIXBSReader(java.io.InputStream in,
                   java.lang.String defaultVersion)
            throws java.io.IOException
Deserializes from an XML document using the given sixbs version if no version is specified in the document itself.

Method Detail

getDefaultVersion

public java.lang.String getDefaultVersion()
Returns the default sixbs version that should be used for parsing.


getVersion

public java.lang.String getVersion()
Returns the actually used version. May return null if the version has not been parsed/set yet.


setReadAhead

public void setReadAhead(int readAhead)
Sets the number of Objects which are read in advance. If you have very big objects you want to keep this low, in order to keep memory consumption low. If speed is more important, set this to a high value. The default value is 10.

See Also:
getReadAhead()

getReadAhead

public int getReadAhead()
Returns the number of Objects that are read in advance.

See Also:
setReadAhead(int)

readObject

public java.lang.Object readObject()
                            throws java.io.IOException
Starts the reading of objects. Note that internally more than a single object is read. Therefore exceptions which might occur, do not have to stem from the object you are currently trying to read, but may be from an object that is read in advance.

Throws:
java.io.EOFException - if the end of file is reached.
java.io.IOException
See Also:
setReadAhead(int)

hasNext

public boolean hasNext()
Indicates whether we can read another object.

Returns:
true, if another object can be read.

close

public void close()
Closes this reader. It is essential that you close the reader after you used it.


finalize

protected void finalize()
                 throws java.lang.Throwable
Throws:
java.lang.Throwable