Package com.hazelcast.nio

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


            }
            final BufferObjectDataOutput out = serializationService.pop();
            final byte[] binary;
            try {
                decompress(compressedBinary, out);
                binary = out.toByteArray();
            } finally {
                serializationService.push(out);
            }
            final ClassDefinitionImpl cd = new ClassDefinitionImpl();
            cd.readData(serializationService.createObjectDataInput(binary));
View Full Code Here


            }
            if (cdImpl.getBinary() == null) {
                final BufferObjectDataOutput out = serializationService.pop();
                try {
                    cdImpl.writeData(out);
                    final byte[] binary = out.toByteArray();
                    out.clear();
                    compress(binary, out);
                    cdImpl.setBinary(out.toByteArray());
                } catch (IOException e) {
                    throw new HazelcastSerializationException(e);
View Full Code Here

                try {
                    cdImpl.writeData(out);
                    final byte[] binary = out.toByteArray();
                    out.clear();
                    compress(binary, out);
                    cdImpl.setBinary(out.toByteArray());
                } catch (IOException e) {
                    throw new HazelcastSerializationException(e);
                } finally {
                    serializationService.push(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(1024);
                try {
                    for (Map.Entry<Long, Data> entry : map.entrySet()) {
                        entry.getValue().writeData(out);
                        objectMap.put(entry.getKey(), out.toByteArray());
                        out.clear();
                    }
                } catch (IOException e) {
                    throw new HazelcastException(e);
                } finally {
View Full Code Here

        final BufferObjectDataOutput out = sendOutput;
        synchronized (sendLock) {
            try {
                out.writeByte(Packet.VERSION);
                out.writeObject(joinMessage);
                datagramPacketSend.setData(out.toByteArray());
                multicastSocket.send(datagramPacketSend);
                out.clear();
            } catch (IOException e) {
                logger.warning("You probably have too long Hazelcast configuration!", e);
            }
View Full Code Here

        try {
            out.writeInt(tasks.size());
            for (Operation task : tasks) {
                serializationService.writeObject(out, task);
            }
            data = out.toByteArray();
        } finally {
            closeResource(out);
        }
        return data;
    }
View Full Code Here

        private byte[] getClassDefBinary(byte[] compressedBinary) throws IOException {
            final BufferObjectDataOutput out = serializationService.pop();
            final byte[] binary;
            try {
                decompress(compressedBinary, out);
                binary = out.toByteArray();
            } finally {
                serializationService.push(out);
            }
            return binary;
        }
View Full Code Here

        private void setClassDefBinary(ClassDefinitionImpl cd) {
            if (cd.getBinary() == null) {
                final BufferObjectDataOutput out = serializationService.pop();
                try {
                    cd.writeData(out);
                    final byte[] binary = out.toByteArray();
                    out.clear();
                    compress(binary, out);
                    cd.setBinary(out.toByteArray());
                } catch (IOException e) {
                    throw new HazelcastSerializationException(e);
View Full Code Here

                try {
                    cd.writeData(out);
                    final byte[] binary = out.toByteArray();
                    out.clear();
                    compress(binary, out);
                    cd.setBinary(out.toByteArray());
                } catch (IOException e) {
                    throw new HazelcastSerializationException(e);
                } finally {
                    serializationService.push(out);
                }
View Full Code Here

            // 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()) {
                    entry.getValue().writeData(out);
                    objectMap.put(entry.getKey(), out.toByteArray());
                    out.clear();
                }
            } catch (IOException e) {
                throw new HazelcastException(e);
            } finally {
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.