Package org.nustaq.serialization

Examples of org.nustaq.serialization.FSTObjectInput


                        {"senum", "ser.Basics$SampleEnum"},
                        {"special", "ser.Basics$SpecialEnum"},
                }
        );
        out = new FSTObjectOutput(conf);
        in = new FSTObjectInput(conf);
    }
View Full Code Here


                //FST.setForceSerializable(true);
                FST.registerSerializer(Bug34.NonSerializableClass.class, new Serializer(), false);
                FSTObjectOutput out = FST.getObjectOutput();
                out.writeObject(new Bug34.NonSerializableClass());

                FSTObjectInput in = FST.getObjectInput(out.getCopyOfWrittenBuffer());
                assertEquals(NonSerializableClass.class, in.readObject().getClass());
        }
View Full Code Here

        } catch (Exception ex) {
            e = ex;
        }
        out.writeObject(e);
        out.flush();
        FSTObjectInput in = new FSTObjectInput(conf);
        in.resetForReuseUseArray(out.getBuffer(),out.getWritten());
        Object ex = in.readObject();
        System.out.println("success "+ex);
    }
View Full Code Here

            FSTObjectOutput out = new FSTObjectOutput(conf);
            out.writeObject(w);
            out.flush();
            b = out.getBuffer();

            FSTObjectInput in = new FSTObjectInput(conf);
            in.resetForReuseUseArray(b, b.length);
            Object res = in.readObject();

            if (!res.equals("bla")) {
                throw new RuntimeException("fail " + res);
            }
View Full Code Here

    protected FSTObjectInput in;
   
    @org.junit.Before
    public void setUp() throws Exception {
        out = new FSTObjectOutput();
        in = new FSTObjectInput();
    }
View Full Code Here

        fout.writeObject(obj);
        fout.writeObject(new byte[1000*1000*10]);
        fout.writeObject(obj);
        fout.close();

        FSTObjectInput fin = new FSTObjectInput(new ByteArrayInputStream(bout.toByteArray()));
        Strings res = (Strings) fin.readObject();
        fin.readObject();
        Strings res1 = (Strings) fin.readObject();
        assertTrue(res == res1);
        assertTrue(DeepEquals.deepEquals(obj,res));
    }
View Full Code Here

        FSTObjectOutput objOut = new FSTObjectOutput(os);
        objOut.writeObject(list);
        objOut.close();

        ByteArrayInputStream is = new ByteArrayInputStream(os.toByteArray());
        FSTObjectInput objIn = new FSTObjectInput(is);
//        objIn.setReadExternalReadAHead(16000);
        TestArray res = (TestArray) objIn.readObject();
        for (int i = 0; i < res.bytes1.length; i++) {
            assertTrue(res.bytes1[i] == 1);
        }
        for (int i = 0; i < res.bytes2.length; i++) {
            assertTrue(res.bytes2[i] == 2);
View Full Code Here

        FSTObjectOutput out = new FSTObjectOutput(conf);
        out.writeObject(holder);
        out.flush();
        b = out.getBuffer();

        FSTObjectInput in = new FSTObjectInput(conf);
        in.resetForReuseUseArray(b,b.length);
        Object res = in.readObject();

        checkEquals(Holder.class, res.getClass());
        checkEquals(String.class, ((Holder) res).o.getClass());
        checkEquals("foo", ((Holder) res).o);
View Full Code Here

TOP

Related Classes of org.nustaq.serialization.FSTObjectInput

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.