public class XIO
extends java.lang.Object
writeUTF(XElement, OutputStream)
and readUTF(InputStream)
to
guarantee maximal independence from the underlying file system.Constructor and Description |
---|
XIO() |
Modifier and Type | Method and Description |
---|---|
static XElement |
read(java.lang.CharSequence text)
Interprets
text as a xml-file and reads it. |
static XElement |
read(org.xml.sax.InputSource source)
Reads a xml-file from
source . |
static XElement |
read(java.io.InputStream in,
java.lang.String encoding)
Reads a xml file provided from
in using encoding
as encoding. |
static XElement |
read(java.io.Reader reader)
Reads a xml file provided from
reader . |
static XElement |
readUTF(java.io.InputStream in)
Reads a xml file provided from
in using UTF-8
as encoding. |
static void |
write(XElement element,
java.lang.Appendable out)
Writes the contents of
element into out . |
static void |
write(XElement element,
java.io.OutputStream out,
java.lang.String encoding)
Writes the contents of
element into out . |
static void |
writeUTF(XElement element,
java.io.OutputStream out)
Writes the contents of
element into out using
the UTF-8 encoding. |
public static void write(XElement element, java.lang.Appendable out) throws java.io.IOException
element
into out
.element
- the element to writeout
- the stream to write intojava.io.IOException
- if an I/O-error occurspublic static void writeUTF(XElement element, java.io.OutputStream out) throws java.io.IOException
element
into out
using
the UTF-8
encoding.element
- the element to writeout
- the stream to write intojava.io.IOException
- if an I/O-error occurspublic static void write(XElement element, java.io.OutputStream out, java.lang.String encoding) throws java.io.IOException
element
into out
.element
- the element to writeout
- the stream to write intoencoding
- the encoding for the charactersjava.io.IOException
- if an I/O-error occurspublic static XElement readUTF(java.io.InputStream in) throws java.io.IOException
in
using UTF-8
as encoding.in
- the stream to read fromjava.io.IOException
- if an I/O-error occurspublic static XElement read(java.io.InputStream in, java.lang.String encoding) throws java.io.IOException
in
using encoding
as encoding.in
- the stream to read fromencoding
- the encoding used to decode charactersjava.io.IOException
- if an I/O-error occurspublic static XElement read(java.lang.CharSequence text) throws java.io.IOException
text
as a xml-file and reads it.text
- the content to read, in xml formattext
java.io.IOException
- if an I/O-error occurspublic static XElement read(org.xml.sax.InputSource source) throws java.io.IOException
source
.source
- the xml-filejava.io.IOException
- if an I/O-error occurspublic static XElement read(java.io.Reader reader) throws java.io.IOException
reader
.reader
- the reader from which characters will be readjava.io.IOException
- if an I/O-error occurs