Package org.apache.pivot.serialization

Examples of org.apache.pivot.serialization.StringSerializer


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

        Serializer<String> serializer = new StringSerializer();

        ByteArrayInputStream inputStream = new ByteArrayInputStream(testBytes);
        String result = serializer.readObject(inputStream);
        assertNotNull(result);
        assertEquals(result, testString);

        // dump content, but useful only for text resources ...
        String dump = result;
View Full Code Here


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

        Serializer<String> serializer = new StringSerializer();

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

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

        String result = outputStream.toString();
View Full Code Here

        try {
            updateStatus("Retrieving Content from URL \"" + url + "\" ...");

            long start = System.currentTimeMillis();
            Serializer<String> serializer = new StringSerializer();
            InputStream inputStream = url.openStream();
            String result = serializer.readObject(inputStream);
            if (result == null){
                result = "";
            }
            long end = System.currentTimeMillis();
View Full Code Here

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

        Serializer<String> serializer = new StringSerializer();

        ByteArrayInputStream inputStream = new ByteArrayInputStream(testBytes);
        String result = serializer.readObject(inputStream);
        assertNotNull(result);
        assertEquals(result, testString);

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

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

        Serializer<String> serializer = new StringSerializer();

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

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

        String result = outputStream.toString();
View Full Code Here

TOP

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

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.