FreeHEP API
Version v1.2.2

org.freehep.util.io
Class XMLSequence

java.lang.Object
  |
  +--java.io.InputStream
        |
        +--org.freehep.util.io.XMLSequence

public class XMLSequence
extends InputStream

The XMLSequence allows parsing by an XML Parser of concatenated XML segments. Each segment needs to start with " XMLSequence sequence = new XMLSequence(new FileInputStream("file.xml")); SAXParserFactory factory = SAXParserFactory.newInstance(); XMLReader xmlReader = factory.newSAXParser().getXMLReader(); while (sequence.hasNext()) { InputStream input = sequence.next(); InputSource source = new InputSource(input); xmlReader.parse(source); input.close(); } sequence.close(); IMPORTANT: inherits from InputStream rather than FilterInputStream so that the correct read(byte[], int, int) method is used.

Version:
$Id: XMLSequence.java,v 1.2 2003/11/03 23:13:10 duns Exp $
Author:
Mark Donszelmann

Constructor Summary
XMLSequence(InputStream input)
           
 
Method Summary
 void close()
           
 boolean hasNext()
           
 void mark(int readLimit)
           
 boolean markSupported()
           
 InputStream next()
           
 int read()
           
 void reset()
           
 
Methods inherited from class java.io.InputStream
available, read, read, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLSequence

public XMLSequence(InputStream input)
Method Detail

hasNext

public boolean hasNext()

next

public InputStream next()
                 throws IOException
IOException

read

public int read()
         throws IOException
Specified by:
read in class InputStream
IOException

mark

public void mark(int readLimit)
Overrides:
mark in class InputStream

markSupported

public boolean markSupported()
Overrides:
markSupported in class InputStream

reset

public void reset()
           throws IOException
Overrides:
reset in class InputStream
IOException

close

public void close()
           throws IOException
Overrides:
close in class InputStream
IOException

FreeHEP API
Version v1.2.2

Copyright © 2000-2003 FreeHEP, All Rights Reserved.