Examples of writeVarInt()


Examples of com.esotericsoftware.kryo.io.ByteBufferOutput.writeVarInt()

          for (int i = 0; i < 16; i++) {
                out1.writeVarInt(92, false);
          }

          for (int i = 0; i < 16; i++) {
                out2.writeVarInt(92, false);
          }
         
          assertEquals(out1.toBytes(), out2.toBytes());
  }
 
View Full Code Here

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

  }

  public void testSimpleVarInt() {
      final int value = 39117;
      final Output out = new UnsafeOutput(1024);
      out.writeVarInt(value, true);
      out.flush();
      final Input in = new UnsafeInput(out.toBytes());
      final int actualValue = in.readVarInt(true);
      assertEquals(value, actualValue);
  }
View Full Code Here

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

          for (int i = 0; i < 16; i++) {
                out1.writeVarInt(92, false);
          }

          for (int i = 0; i < 16; i++) {
                out2.writeVarInt(92, false);
          }
         
          assertEquals(out1.toBytes(), out2.toBytes());
  }
 
View Full Code Here

Examples of com.esotericsoftware.kryo.io.UnsafeMemoryOutput.writeVarInt()

    UnsafeMemoryOutput write = new UnsafeMemoryOutput(new ByteArrayOutputStream());

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

    write.writeVarInt(400, true);

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

Examples of com.esotericsoftware.kryo.io.UnsafeOutput.writeVarInt()

    UnsafeOutput write = new UnsafeOutput(new ByteArrayOutputStream());

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

    write.writeVarInt(400, true);

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

Examples of com.esotericsoftware.kryo.io.UnsafeOutput.writeVarInt()

  }

  public void testSimpleVarInt() {
      final int value = 39117;
      final Output out = new UnsafeOutput(1024);
      out.writeVarInt(value, true);
      out.flush();
      final Input in = new UnsafeInput(out.toBytes());
      final int actualValue = in.readVarInt(true);
      assertEquals(value, actualValue);
  }
View Full Code Here

Examples of org.fusesource.hawtbuf.AbstractVarIntSupport.writeVarInt()

        // We should get good compression since ranges should be
        // close to each other and we are just recording a var int
        // of the difference between the points.
        int base = 0;
        for( Range range: values) {
            helper.writeVarInt(range.start-base);
            base = range.start;
            helper.writeVarInt(range.end-base);
            base = range.end;
        }
View Full Code Here

Examples of org.fusesource.hawtbuf.AbstractVarIntSupport.writeVarInt()

        // of the difference between the points.
        int base = 0;
        for( Range range: values) {
            helper.writeVarInt(range.start-base);
            base = range.start;
            helper.writeVarInt(range.end-base);
            base = range.end;
        }

    }
View Full Code Here

Examples of org.fusesource.hawtbuf.DataByteArrayOutputStream.writeVarInt()

    }

    private MessagePB.Bean createMessagePB(Message message, long messageKey) throws IOException {
        DataByteArrayOutputStream mos = new DataByteArrayOutputStream();
        mos.writeBoolean(TIGHT_ENCODING);
        mos.writeVarInt(OPENWIRE_VERSION);
        wireformat.marshal(message, mos);

        MessagePB.Bean messageRecord = new MessagePB.Bean();
        messageRecord.setCodec(codec_id);
        messageRecord.setMessageKey(messageKey);
View Full Code Here

Examples of org.fusesource.hawtbuf.DataByteArrayOutputStream.writeVarInt()

    }

    private MessagePB.Bean createMessagePB(Message message, long messageKey) throws IOException {
        DataByteArrayOutputStream mos = new DataByteArrayOutputStream();
        mos.writeBoolean(TIGHT_ENCODING);
        mos.writeVarInt(OPENWIRE_VERSION);
        wireformat.marshal(message, mos);

        MessagePB.Bean messageRecord = new MessagePB.Bean();
        messageRecord.setCodec(codec_id);
        messageRecord.setMessageKey(messageKey);
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.