Package com.esotericsoftware.kryo.io

Examples of com.esotericsoftware.kryo.io.Output.total()


    kryo.setRegistrationRequired(true);

    output.clear();
    kryo.writeClassAndObject(output, c);
    output.flush();
    assertEquals(14, output.total());

    Input input = new Input(output.getBuffer());
    kryo.readClassAndObject(input);

    try {
View Full Code Here


            final Kryo kryo = kryoThreadLocal.get();
            try (final OutputStream baos = new ByteArrayOutputStream()) {
                final Output output = new Output(baos);
                kryo.writeClassAndObject(output, message);

                final long size = output.total();
                if (size > Integer.MAX_VALUE)
                    throw new SerializationException(String.format("Message size of %s exceeds allocatable space", size));

                encodedMessage = allocator.buffer((int) output.total());
                encodedMessage.writeBytes(output.toBytes());
View Full Code Here

                final long size = output.total();
                if (size > Integer.MAX_VALUE)
                    throw new SerializationException(String.format("Message size of %s exceeds allocatable space", size));

                encodedMessage = allocator.buffer((int) output.total());
                encodedMessage.writeBytes(output.toBytes());
            }

            return encodedMessage;
        } catch (Exception ex) {
View Full Code Here

                request.put(SerTokens.TOKEN_OP, requestMessage.getOp());
                request.put(SerTokens.TOKEN_ARGS, requestMessage.getArgs());

                kryo.writeClassAndObject(output, request);

                final long size = output.total();
                if (size > Integer.MAX_VALUE)
                    throw new SerializationException(String.format("Message size of %s exceeds allocatable space", size));

                encodedMessage = allocator.buffer((int) size);
                encodedMessage.writeBytes(output.toBytes());
View Full Code Here

    kryo.setRegistrationRequired(true);

    output.clear();
    kryo.writeClassAndObject(output, c);
    output.flush();
    assertEquals(14, output.total());

    Input input = new Input(output.getBuffer());
    kryo.readClassAndObject(input);

    try {
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.