Package com.thoughtworks.xstream.io.binary

Examples of com.thoughtworks.xstream.io.binary.BinaryStreamWriter


    public XStreamBinary() {
        this.xstream = new XStream();
    }

    public void serialize(Object object, OutputStream output) throws Exception {
        xstream.marshal(object, new BinaryStreamWriter(output));
    }
View Full Code Here


    }

    private void assertBinarySerialization(Object root) {
        // Serialize as binary
        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        xstream.marshal(root, new BinaryStreamWriter(outputStream));

        // Deserialize the binary and check it equals the original object.
        ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
        Object binaryResult = xstream.unmarshal(new BinaryStreamReader(inputStream));
        assertObjectsEqual(root, binaryResult);
View Full Code Here

TOP

Related Classes of com.thoughtworks.xstream.io.binary.BinaryStreamWriter

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.