Package org.nustaq.serialization.simpleapi

Examples of org.nustaq.serialization.simpleapi.OnHeapCoder


        System.out.println("unshared ..");
        carBenchIntern(false);
    }

    public void carBenchIntern(boolean shared) throws Exception {
        OnHeapCoder coder =new OnHeapCoder(shared,
                Car.class, CarBenchBinarized.Engine.class, CarBenchBinarized.Model.class,
                CarBenchBinarized.Accel.class, CarBenchBinarized.PerformanceFigures.class,
                CarBenchBinarized.FueldData.class, CarBenchBinarized.OptionalExtras.class);

        byte arr[] = new byte[10000];
View Full Code Here


*/
public class BinaryStringOffHeapTest extends StringOffHeapTest {

    @Override
    protected FSTCoder createCoder() {
        return new OnHeapCoder();
    }
View Full Code Here

        System.out.println("unshared ..");
        carBenchIntern(false);
    }

    public void carBenchIntern(boolean shared) throws Exception {
        OnHeapCoder coder =new OnHeapCoder(shared,
                Car.class, CarBench.Engine.class, CarBench.Model.class,
                CarBench.Accel.class, CarBench.PerformanceFigures.class,
                CarBench.FueldData.class, CarBench.OptionalExtras.class);

        byte arr[] = new byte[10000];
View Full Code Here

        System.out.println("unshared ..");
        testOnHeapCoder0(false);
    }

    public void testOnHeapCoder0(boolean shared) throws Exception {
        OnHeapCoder coder =new OnHeapCoder(shared,
                CarBench.Car.class, CarBench.Engine.class, CarBench.Model.class,
                CarBench.Accel.class, CarBench.PerformanceFigures.class,
                CarBench.FueldData.class, CarBench.OptionalExtras.class);

        byte arr[] = new byte[1000000];
        int len = coder.toByteArray(original, arr, 0, (int) arr.length);

        Object deser = coder.toObject(arr, 0, (int) arr.length);
        assertTrue(DeepEquals.deepEquals(deser,original));

        onhbench(original, coder, arr, 0);
        onhbench(original, coder, arr, 0);
        onhbench(original, coder, arr, 0);
        onhbench(original, coder, arr, 0);
        deser = onhbench(original, coder, arr, 0);
        assertTrue(DeepEquals.deepEquals(original, deser));

        System.out.println("-----");
        deser = onhbench(smallClazz, coder, arr, 0);
        deser = onhbench(smallClazz, coder, arr, 0);
        deser = onhbench(smallClazz, coder, arr, 0);
        deser = onhbench(smallClazz, coder, arr, 0);
        deser = onhbench(smallClazz, coder, arr, 0);
        assertTrue(DeepEquals.deepEquals(smallClazz, deser));

        boolean lenEx = false;
        try {
            coder.toByteArray(original, arr, 0, 10);
        } catch (Exception e) {
            lenEx = true;
        }

        Assert.assertTrue(lenEx);
View Full Code Here

TOP

Related Classes of org.nustaq.serialization.simpleapi.OnHeapCoder

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.