Package pivot.serialization

Examples of pivot.serialization.ByteArraySerializer


    @Test(timeout = 2000)
    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(timeout = 2000)
    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 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.