Examples of readObject()


Examples of org.apache.niolex.commons.stream.JsonProxy.readObject()

        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        JacksonUtil.writeObj(bos, bench);
        JacksonUtil.writeObj(bos, q);
        byte[] bs = bos.toByteArray();
        JsonProxy iii = new JsonProxy(new ByteArrayInputStream(bs));
        Benchmark cp = iii.readObject(Benchmark.class);
        Bean t = iii.readObject(Bean.class);
        assertTrue(t.getId() != 0);
        assertTrue(t.getBirth().getTime() == 1338008328334L);
        assertTrue(bench.equals(cp));
      } catch (IOException e) {
View Full Code Here

Examples of org.apache.niolex.commons.stream.KryoInstream.readObject()

      ooo.writeObject(bench);
      ooo.writeObject(q);
      ooo.close();
      byte[] bs = bos.toByteArray();
      KryoInstream iii = new KryoInstream(new ByteArrayInputStream(bs));
      Benchmark cp = iii.readObject(Benchmark.class);
      Bean t = iii.readObject(Bean.class);
      assertTrue(t.getId() != 0);
      assertTrue(t.getBirth().getTime() == 1338008328334L);
      assertTrue(bench.equals(cp));
    }
View Full Code Here

Examples of org.apache.niolex.commons.stream.SmileProxy.readObject()

        ByteArrayOutputStream bos = new ByteArrayOutputStream();
        SmileUtil.writeObj(bos, bench);
        SmileUtil.writeObj(bos, q);
        byte[] bs = bos.toByteArray();
        SmileProxy iii = new SmileProxy(new ByteArrayInputStream(bs));
        Benchmark cp = iii.readObject(Benchmark.class);
        Bean t = iii.readObject(Bean.class);
        assertTrue(t.getId() != 0);
        assertTrue(t.getBirth().getTime() == 1338008328334L);
        assertTrue(bench.equals(cp));
      } catch (IOException e) {
View Full Code Here

Examples of org.apache.openejb.core.ivm.EjbObjectInputStream.readObject()

            out.writeObject(source);
            out.close();

            ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
            ObjectInputStream in = new EjbObjectInputStream(bais);
            Object copy = in.readObject();
            return copy;
        } finally {
            IntraVmCopyMonitor.postCrossClassLoaderOperation();
        }
    }
View Full Code Here

Examples of org.apache.openejb.util.ObjectInputStreamExt.readObject()

        oos.writeObject(object);
        oos.flush();
        oos.close();
        ByteArrayInputStream bais = new ByteArrayInputStream(baos.toByteArray());
        ObjectInputStreamExt ois = new ObjectInputStreamExt(bais, classLoader);
        return ois.readObject();
    }

    public static Object readObject(Class type, InputStream in) {
        if (type == Void.TYPE) {
            return null;
View Full Code Here

Examples of org.apache.pivot.beans.BXMLSerializer.readObject()

            public boolean mouseClick(Component component, Mouse.Button button, int x, int y, int count) {
                try {
                    if (count == 2) {
                        TrackData trackData = (TrackData) tracksTableView.getSelectedRow();
                        BXMLSerializer wtkxSerializer = new BXMLSerializer();
                        EditTrackWindow window = (EditTrackWindow) wtkxSerializer.readObject(getClass().getResource("EditTrackWindow.bxml"),new Resources(resources, EditTrackWindow.class.getName()));
                        window.open(getDisplay(), getWindow(), trackData.track);
                        return true;
                    }
                } catch (IOException e) {
                    throw new RuntimeException(e);
View Full Code Here

Examples of org.apache.pivot.json.JSONSerializer.readObject()

        try {
            InputStream inputStream = stylesheetLocation.openStream();

            try {
                JSONSerializer serializer = new JSONSerializer();
                Map<String, ?> stylesheet = (Map<String, ?>)serializer.readObject(inputStream);

                for (String name : stylesheet) {
                    Map<String, ?> styles = (Map<String, ?>)stylesheet.get(name);

                    int i = name.lastIndexOf('.') + 1;
View Full Code Here

Examples of org.apache.pivot.serialization.BinarySerializer.readObject()

                outputStream.close();
            }

            ByteArrayInputStream inputStream = new ByteArrayInputStream(outputStream.toByteArray());
            try {
                inputData = (Object[])serializer.readObject(inputStream);
            } finally {
                inputStream.close();
            }

            assertArrayEquals(outputData, inputData);
View Full Code Here

Examples of org.apache.pivot.serialization.ByteArraySerializer.readObject()

        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

Examples of org.apache.pivot.serialization.CSVSerializer.readObject()

                                page = new ArrayList<Object>(pageSize);
                            }
                        }
                    });

                    csvSerializer.readObject(inputStream);
                } finally {
                    if (inputStream != null) {
                        inputStream.close();
                    }
                }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.