Package org.caffinitas.mapper.core.codec

Examples of org.caffinitas.mapper.core.codec.TypeCodec$MapCodec


                }
                ByteBuffer name = s.duplicate();
                int e = s.position() + alias;
                name.limit(e);
                s.position(e);
                TypeCodec codec = TypeCodec.utf8Instance;
                String typeStr = (String) codec.deserialize(name);
                dataType = CassandraTypeParser.parseOne(protocolVersion, typeStr);
            }

            // read component value
            if (s.remaining() < 2) {
View Full Code Here


    @SuppressWarnings("unchecked") public ByteBuffer serialize() {
        // see Javadoc of org.apache.cassandra.db.marshal.DynamicCompositeType for protocol description
        int l = 0;

        TypeCodec codec = TypeCodec.utf8Instance;

        ByteBuffer[] types = new ByteBuffer[dataTypes.size()];

        for (int i = 0; i < dataTypes.size(); i++) {
            DataType dataType = dataTypes.get(i);
            ByteBuffer arg = components.get(i);

            // serialize type
            String typeStr = dataType.cassandraType();
            // TODO support type aliases for DynamicComposite
            ByteBuffer typeBin = types[i] = codec.serialize(typeStr);
            int sz = typeBin.remaining();
            if (sz > 65535)
                throw new IllegalArgumentException("Component at index #"+i+" in DynamicCompositeType too long ("+sz+") - max 65535 bytes in serialized form");
            l += 2 + sz;
View Full Code Here

TOP

Related Classes of org.caffinitas.mapper.core.codec.TypeCodec$MapCodec

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.