com.sun.portal.search.soif
Class SOIFInputStream

java.lang.Object
  |
  +--com.sun.portal.search.soif.SOIFInputStream

public class SOIFInputStream
extends Object

SOIFInputStream class. Reads serialized SOIF objects from an input stream.


Field Summary
 boolean debug
          debug
 
Constructor Summary
SOIFInputStream(byte[] data)
          Creates a SOIFInputStream reading from a byte array.
SOIFInputStream(byte[] data, String encoding)
          Creates a SOIFInputStream reading from a byte array.
SOIFInputStream(InputStream is)
          Creates a SOIFInputStream reading from an InputStream.
SOIFInputStream(InputStream is, String encoding)
          Creates a SOIFInputStream reading from an InputStream.
SOIFInputStream(SOIFBuffer sb)
          Creates a SOIFInputStream reading from a SOIFBuffer.
SOIFInputStream(String filename)
          Creates a SOIFInputStream reading from the named file.
SOIFInputStream(String filename, String encoding)
          Creates a SOIFInputStream reading from the named file.
 
Method Summary
 boolean close()
          Closes the stream.
 boolean isEOS()
           
 SOIF readSOIF()
          Reads a single SOIF from the underlying input stream.
 void setAllowed(Set attrs)
          Sets a SOIF attribute filter.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

debug

public final boolean debug
debug
Constructor Detail

SOIFInputStream

public SOIFInputStream(String filename)
                throws FileNotFoundException
Creates a SOIFInputStream reading from the named file.
Parameters:
filename - the SOIF source file

SOIFInputStream

public SOIFInputStream(String filename,
                       String encoding)
                throws FileNotFoundException,
                       UnsupportedEncodingException
Creates a SOIFInputStream reading from the named file.
Parameters:
filename - the SOIF source file
encoding - the character encoding of the input SOIF

SOIFInputStream

public SOIFInputStream(byte[] data,
                       String encoding)
                throws UnsupportedEncodingException
Creates a SOIFInputStream reading from a byte array.
Parameters:
data - the SOIF source byte array
encoding - the character encoding of the input SOIF

SOIFInputStream

public SOIFInputStream(byte[] data)
Creates a SOIFInputStream reading from a byte array.
Parameters:
data - the SOIF source byte array

SOIFInputStream

public SOIFInputStream(SOIFBuffer sb)
Creates a SOIFInputStream reading from a SOIFBuffer.
Parameters:
data - the SOIF source SOIFBuffer

SOIFInputStream

public SOIFInputStream(InputStream is)
Creates a SOIFInputStream reading from an InputStream.
Parameters:
filename - the SOIF source InoutStream

SOIFInputStream

public SOIFInputStream(InputStream is,
                       String encoding)
                throws UnsupportedEncodingException
Creates a SOIFInputStream reading from an InputStream.
Parameters:
filename - the SOIF source InoutStream
encoding - the character encoding of the input SOIF
Method Detail

setAllowed

public void setAllowed(Set attrs)
Sets a SOIF attribute filter. Only attributes in the allowed set will be read from the input stream.
Parameters:
attrs - the set of allowed attributes (use lower case)

readSOIF

public SOIF readSOIF()
              throws IOException
Reads a single SOIF from the underlying input stream.
Returns:
the next SOIF object from the input stream
Throws:
SOIFException - if error in SOIF
IOException - if an I/O error occurs
EOFException - if read past end of stream

isEOS

public boolean isEOS()
Returns:
true if stream is at EOS

close

public boolean close()
Closes the stream.
Returns:
false on I/O error