FreeHEP API
Version current

org.freehep.util.io
Class XMLSequence

java.lang.Object
  extended byjava.io.InputStream
      extended byorg.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.4 2004/07/24 06:05:18 duns Exp $
Author:
Mark Donszelmann
Source Code:
XMLSequence.java

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
Throws:
IOException

read

public int read()
         throws IOException
Throws:
IOException

mark

public void mark(int readLimit)

markSupported

public boolean markSupported()

reset

public void reset()
           throws IOException
Throws:
IOException

close

public void close()
           throws IOException
Throws:
IOException

FreeHEP API
Version current

Copyright © 2000-2004 FreeHEP, All Rights Reserved.