net.sf.freecol.common.util
Class XMLStream

java.lang.Object
  extended by net.sf.freecol.common.util.XMLStream
All Implemented Interfaces:
java.io.Closeable

public class XMLStream
extends java.lang.Object
implements java.io.Closeable

A wrapper for XMLStreamReader and the underlying stream. The close method on XMLStreamReader doesn't close the underlying stream. This class is a wrapper for the XMLStreamReader and the underlying stream with a close() method which close them both.


Constructor Summary
XMLStream(java.io.InputStream inputStream)
          Creates a new XMLStream.
 
Method Summary
 void close()
          Closes both the XMLStreamReader and the underlying stream.
 javax.xml.stream.XMLStreamReader getXMLStreamReader()
          Get the XMLStreamReader.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

XMLStream

public XMLStream(java.io.InputStream inputStream)
          throws java.io.IOException
Creates a new XMLStream.

Parameters:
inputStream - The InputStream to create a XMLStreamReader for.
Throws:
java.io.IOException - if thrown while creating the XMLStreamReader.
Method Detail

getXMLStreamReader

public javax.xml.stream.XMLStreamReader getXMLStreamReader()
Get the XMLStreamReader.

Returns:
The XMLStreamReader created using the underlying stream provided by the contructor on this object.

close

public void close()
Closes both the XMLStreamReader and the underlying stream.

Specified by:
close in interface java.io.Closeable