Package com.sleepycat.bdb.bind.tuple

Examples of com.sleepycat.bdb.bind.tuple.TupleMarshalledBinding


    private DataBinding getKeyBinding(Class keyClass) {

        DataBinding binding = TupleBinding.getPrimitiveBinding(keyClass,
                                                               TUPLE_FORMAT);
        if (binding == null) {
            binding = new TupleMarshalledBinding(TUPLE_FORMAT, keyClass);
        }
        return binding;
    }
View Full Code Here


    // also tests TupleBinding since TupleMarshalledBinding extends it
    public void testTupleMarshalledBinding()
        throws IOException {

        DataBinding binding =
            new TupleMarshalledBinding(format, MarshalledObject.class);
        assertSame(format, binding.getDataFormat());

        MarshalledObject val = new MarshalledObject("abc", "", "", "");
        binding.objectToData(val, buffer);
        assertEquals(val.expectedDataLength(), buffer.getDataLength());

        Object result = binding.dataToObject(buffer);
        assertTrue(result instanceof MarshalledObject);
        val = (MarshalledObject) result;
        assertEquals("abc", val.getData());
    }
View Full Code Here

TOP

Related Classes of com.sleepycat.bdb.bind.tuple.TupleMarshalledBinding

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.