Package org.apache.pivot.serialization

Examples of org.apache.pivot.serialization.ByteArraySerializer


    @Test
    public void readValues() throws IOException, SerializationException {
        log("readValues()");

        Serializer<byte[]> serializer = new ByteArraySerializer();

        ByteArrayInputStream inputStream = new ByteArrayInputStream(testBytes);
        byte[] result = serializer.readObject(inputStream);
        assertNotNull(result);

        // dump content, but useful only for text resources ...
        String dump = new String(result);
        int dumpLength = dump.getBytes().length;
View Full Code Here


    @Test
    public void writeValues() throws IOException, SerializationException {
        log("writeValues()");

        Serializer<byte[]> serializer = new ByteArraySerializer();

        ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
        serializer.writeObject(testBytes, outputStream);

        outputStream.flush();
        outputStream.close();

        byte[] result = outputStream.toByteArray();
View Full Code Here

TOP

Related Classes of org.apache.pivot.serialization.ByteArraySerializer

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.