Package com.esotericsoftware.kryo.io

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


/** @author Nathan Sweet <misc@n4te.com> */
public class ChunkedTest extends KryoTestCase {
  public void testChunks () {
    Output output = new Output(512);
    output.writeInt(1234);
    OutputChunked outputChunked = new OutputChunked(output);
    outputChunked.writeInt(1);
    outputChunked.endChunks();
    outputChunked.writeInt(2);
    outputChunked.endChunks();
View Full Code Here


    outputChunked.endChunks();
    outputChunked.writeInt(4);
    outputChunked.endChunks();
    outputChunked.writeInt(5);
    outputChunked.endChunks();
    output.writeInt(5678);
    output.close();

    Input input = new Input(output.getBuffer());
    assertEquals(1234, input.readInt());
    InputChunked inputChunked = new InputChunked(input);
View Full Code Here

    Output write = new Output(new ByteArrayOutputStream());

    Input read = new Input(write.toBytes());
    assertEquals(false, read.canReadInt());

    write.writeInt(400, true);

    read = new Input(write.toBytes());
    assertEquals(true, read.canReadInt());
    read.setLimit(read.limit() - 1);
    assertEquals(false, read.canReadInt());
View Full Code Here

    Output write = new Output(new ByteArrayOutputStream());

    Input read = new Input(write.toBytes());
    assertEquals(false, read.canReadInt());

    write.writeInt(400, true);

    read = new Input(write.toBytes());
    assertEquals(true, read.canReadInt());
    read.setLimit(read.limit() - 1);
    assertEquals(false, read.canReadInt());
View Full Code Here

                throw new UncheckedIOException(e);
            }


            try {
                indexOutput.writeInt(index.size(), true);

                for (Map.Entry<Long, Map<Long, TestCaseRegion>> classEntry : index.entrySet()) {
                    Long classId = classEntry.getKey();
                    Map<Long, TestCaseRegion> regions = classEntry.getValue();
View Full Code Here

                for (Map.Entry<Long, Map<Long, TestCaseRegion>> classEntry : index.entrySet()) {
                    Long classId = classEntry.getKey();
                    Map<Long, TestCaseRegion> regions = classEntry.getValue();

                    indexOutput.writeLong(classId, true);
                    indexOutput.writeInt(regions.size(), true);

                    for (Map.Entry<Long, TestCaseRegion> testCaseEntry : regions.entrySet()) {
                        long id = testCaseEntry.getKey();
                        TestCaseRegion region = testCaseEntry.getValue();
                        indexOutput.writeLong(id, true);
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.