Package com.thoughtworks.xstream.io

Examples of com.thoughtworks.xstream.io.StreamException


    public HierarchicalStreamWriter createWriter(final OutputStream out) {
        try {
            // JSON spec requires UTF-8
            return createWriter(new OutputStreamWriter(out, "UTF-8"));
        } catch (final UnsupportedEncodingException e) {
            throw new StreamException(e);
        }
    }
View Full Code Here


    @Override
    public HierarchicalStreamReader createReader(final Reader reader) {
        try {
            return new StaxReader(new QNameMap(), mif.createXMLStreamReader(reader), getNameCoder());
        } catch (final XMLStreamException e) {
            throw new StreamException(e);
        }
    }
View Full Code Here

    @Override
    public HierarchicalStreamReader createReader(final InputStream input) {
        try {
            return new StaxReader(new QNameMap(), mif.createXMLStreamReader(input), getNameCoder());
        } catch (final XMLStreamException e) {
            throw new StreamException(e);
        }
    }
View Full Code Here

        try {
            instream = in.openStream();
            return new StaxReader(new QNameMap(), mif.createXMLStreamReader(in.toExternalForm(), instream),
                getNameCoder());
        } catch (final XMLStreamException e) {
            throw new StreamException(e);
        } catch (final IOException e) {
            throw new StreamException(e);
        } finally {
            if (instream != null) {
                try {
                    instream.close();
                } catch (final IOException e) {
View Full Code Here

        try {
            instream = new FileInputStream(in);
            return new StaxReader(new QNameMap(), mif.createXMLStreamReader(in.toURI().toASCIIString(), instream),
                getNameCoder());
        } catch (final XMLStreamException e) {
            throw new StreamException(e);
        } catch (final IOException e) {
            throw new StreamException(e);
        } finally {
            if (instream != null) {
                try {
                    instream.close();
                } catch (final IOException e) {
View Full Code Here

                    convention);
            } else {
                return new StaxWriter(new QNameMap(), mof.createXMLStreamWriter(writer), getNameCoder());
            }
        } catch (final XMLStreamException e) {
            throw new StreamException(e);
        }
    }
View Full Code Here

                    convention);
            } else {
                return new StaxWriter(new QNameMap(), mof.createXMLStreamWriter(output), getNameCoder());
            }
        } catch (final XMLStreamException e) {
            throw new StreamException(e);
        }
    }
View Full Code Here

                xstream.toXML(value, writer);
            } finally {
                writer.close();
            }
        } catch (final IOException e) {
            throw new StreamException(e);
        }
    }
View Full Code Here

            }
        } catch (final FileNotFoundException e) {
            // not found... file.exists might generate a sync problem
            return null;
        } catch (final IOException e) {
            throw new StreamException(e);
        }
    }
View Full Code Here

                return COMMENT;
            default:
                return OTHER;
            }
        } catch (final XMLStreamException e) {
            throw new StreamException(e);
        }
    }
View Full Code Here

TOP

Related Classes of com.thoughtworks.xstream.io.StreamException

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.