Package com.alibaba.dubbo.common.serialize

Examples of com.alibaba.dubbo.common.serialize.ObjectInput


            }
        }
        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(byteArray);
       
        try {
            ObjectInput deserialize = serialization.deserialize(url, byteArrayInputStream);
            @SuppressWarnings("unused") // local variable, convenient for debug
            Object read = deserialize.readObject();
            fail();
        } catch (JSONException expected) {
            System.out.println(expected);
        }
    }
View Full Code Here


            }
        }
        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(byteArray);
       
        try {
            ObjectInput deserialize = serialization.deserialize(url, byteArrayInputStream);
            @SuppressWarnings("unused") // local variable, convenient for debug
            Object read = deserialize.readObject(MediaContent.class);
            fail();
        } catch (JSONException expected) {
            System.out.println(expected);
        }
    }
View Full Code Here

        objectOutput.writeObject(data);
        objectOutput.flushBuffer();
       
        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(
                byteArrayOutputStream.toByteArray());
        ObjectInput deserialize = serialization.deserialize(url, byteArrayInputStream);
       
        assertTrue(Arrays.equals(data, (boolean[]) deserialize.readObject(boolean[].class)));
       
        try {
            deserialize.readObject(boolean[].class);
            fail();
        }
        catch (ArrayIndexOutOfBoundsException e) {}
        // NOTE: Hessian2抛出了ArrayIndexOutOfBoundsException 而不是 IOException!!
        // 容忍这个问题!!
View Full Code Here

        objectOutput.writeObject(data);
        objectOutput.flushBuffer();
       
        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(
                byteArrayOutputStream.toByteArray());
        ObjectInput deserialize = serialization.deserialize(url, byteArrayInputStream);
       
        assertArrayEquals(data, (short[]) deserialize.readObject(short[].class));
       
        try {
            deserialize.readObject(short[].class);
            fail();
        }
        catch (ArrayIndexOutOfBoundsException e) {}
        // NOTE: Hessian2抛出了ArrayIndexOutOfBoundsException 而不是 IOException!!
        // 容忍这个问题!!
View Full Code Here

        objectOutput.writeObject(data);
        objectOutput.flushBuffer();

        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(
                byteArrayOutputStream.toByteArray());
        ObjectInput deserialize = serialization.deserialize(url, byteArrayInputStream);

        assertArrayEquals(data, (int[]) deserialize.readObject());

        try {
            deserialize.readObject(int[].class);
            fail();
        }
        catch (ArrayIndexOutOfBoundsException e) {}
        // NOTE: Hessian2抛出了ArrayIndexOutOfBoundsException 而不是 IOException!!
        // 容忍这个问题!!
View Full Code Here

        objectOutput.writeObject(data);
        objectOutput.flushBuffer();

        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(
                byteArrayOutputStream.toByteArray());
        ObjectInput deserialize = serialization.deserialize(url, byteArrayInputStream);

        assertArrayEquals(data, (long[]) deserialize.readObject());

        try {
            deserialize.readObject(long[].class);
            fail();
        }
        catch (ArrayIndexOutOfBoundsException e) {}
        // NOTE: Hessian2抛出了ArrayIndexOutOfBoundsException 而不是 IOException!!
        // 容忍这个问题!!
View Full Code Here

        objectOutput.writeObject(data);
        objectOutput.flushBuffer();
       
        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(
                byteArrayOutputStream.toByteArray());
        ObjectInput deserialize = serialization.deserialize(url, byteArrayInputStream);
       
        assertArrayEquals(data, (float[]) deserialize.readObject(), 0.0001F);
       
        try {
            deserialize.readObject(float[].class);
            fail();
        }
        catch (ArrayIndexOutOfBoundsException e) {}
        // NOTE: Hessian2抛出了ArrayIndexOutOfBoundsException 而不是 IOException!!
        // 容忍这个问题!!
View Full Code Here

        objectOutput.writeObject(data);
        objectOutput.flushBuffer();
       
        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(
                byteArrayOutputStream.toByteArray());
        ObjectInput deserialize = serialization.deserialize(url, byteArrayInputStream);
       
        assertArrayEquals(data, (double[]) deserialize.readObject(double[].class), 0.0001);
       
        try {
            deserialize.readObject(double[].class);
            fail();
        }
        catch (ArrayIndexOutOfBoundsException e) {}
        // NOTE: Hessian2抛出了ArrayIndexOutOfBoundsException 而不是 IOException!!
        // 容忍这个问题!!
View Full Code Here

        objectOutput.writeObject(data);
        objectOutput.flushBuffer();

        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(
                byteArrayOutputStream.toByteArray());
        ObjectInput deserialize = serialization.deserialize(url, byteArrayInputStream);

        assertArrayEquals(data, deserialize.readObject(String[].class));

        try {
            deserialize.readObject(String[].class);
            fail();
        }
        catch (ArrayIndexOutOfBoundsException e) {}
        // NOTE: Hessian2抛出了ArrayIndexOutOfBoundsException 而不是 IOException!!
        // 容忍这个问题!!
View Full Code Here

        objectOutput.writeLong(123L);
        objectOutput.flushBuffer();

        ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(
                byteArrayOutputStream.toByteArray());
        ObjectInput deserialize = serialization.deserialize(url, byteArrayInputStream);

        assertEquals(123L, deserialize.readLong());

        try {
            deserialize.readLong();
            fail();
        } catch (IOException expected) {
        }
    }
View Full Code Here

TOP

Related Classes of com.alibaba.dubbo.common.serialize.ObjectInput

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.