Package com.hazelcast.nio

Examples of com.hazelcast.nio.BufferObjectDataOutput.writeData()


        // register class def
        transferClassDefinition(data, serializationService, serializationService2);

        // emulate socket write by writing data to stream
        BufferObjectDataOutput out = serializationService.createObjectDataOutput(1024);
        out.writeData(data);
        byte[] bytes = out.toByteArray();
        byte[] header = ((PortableDataOutput) out).getPortableHeader();

        // emulate socket read by reading data from stream
        BufferObjectDataInput in = serializationService2.createObjectDataInput(new DefaultData(0, bytes, 0, header));
View Full Code Here


        if (binary) {
            // WARNING: we can't pass original Data to the user
            int size = QuickMath.normalize(value.dataSize(), BUFFER_SIZE_FACTOR);
            BufferObjectDataOutput out = serializationService.createObjectDataOutput(size);
            try {
                out.writeData(value);
                actualValue = out.toByteArray();
            } catch (IOException e) {
                throw new HazelcastException(e);
            } finally {
                IOUtil.closeResource(out);
View Full Code Here

            // TODO: @mm - is there really an advantage of using binary storeAll?
            // since we need to do array copy for each item.
            BufferObjectDataOutput out = serializationService.createObjectDataOutput(OUTPUT_SIZE);
            try {
                for (Map.Entry<Long, Data> entry : map.entrySet()) {
                    out.writeData(entry.getValue());
                    objectMap.put(entry.getKey(), out.toByteArray());
                    out.clear();
                }
            } catch (IOException e) {
                throw new HazelcastException(e);
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.