public class XIO extends 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(CharSequence text)
Interprets
text as a xml-file and reads it. |
static XElement |
read(InputSource source)
Reads a xml-file from
source . |
static XElement |
read(InputStream in,
String encoding)
Reads a xml file provided from
in using encoding
as encoding. |
static XElement |
read(Reader reader)
Reads a xml file provided from
reader . |
static XElement |
readUTF(InputStream in)
Reads a xml file provided from
in using UTF-8
as encoding. |
static void |
write(XElement element,
Appendable out)
Writes the contents of
element into out . |
static void |
write(XElement element,
OutputStream out,
String encoding)
Writes the contents of
element into out . |
static void |
writeUTF(XElement element,
OutputStream out)
Writes the contents of
element into out using
the UTF-8 encoding. |
public static void write(XElement element, Appendable out) throws IOException
element
into out
.element
- the element to writeout
- the stream to write intoIOException
- if an I/O-error occurspublic static void writeUTF(XElement element, OutputStream out) throws IOException
element
into out
using
the UTF-8
encoding.element
- the element to writeout
- the stream to write intoIOException
- if an I/O-error occurspublic static void write(XElement element, OutputStream out, String encoding) throws IOException
element
into out
.element
- the element to writeout
- the stream to write intoencoding
- the encoding for the charactersIOException
- if an I/O-error occurspublic static XElement readUTF(InputStream in) throws IOException
in
using UTF-8
as encoding.in
- the stream to read fromIOException
- if an I/O-error occurspublic static XElement read(InputStream in, String encoding) throws IOException
in
using encoding
as encoding.in
- the stream to read fromencoding
- the encoding used to decode charactersIOException
- if an I/O-error occurspublic static XElement read(CharSequence text) throws IOException
text
as a xml-file and reads it.text
- the content to read, in xml formattext
IOException
- if an I/O-error occurspublic static XElement read(InputSource source) throws IOException
source
.source
- the xml-fileIOException
- if an I/O-error occurspublic static XElement read(Reader reader) throws IOException
reader
.reader
- the reader from which characters will be readIOException
- if an I/O-error occurs