Examples of toBytes()


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

    assertEquals(new byte[] { //
      11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, //
        31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, //
        51, 52, 53, 54, 55, 56, 57, 58, //
        61, 62, 63, 64, 65}, buffer.toBytes());
  }

  public void testStrings () throws IOException {
    runStringTest(new UnsafeMemoryOutput(4096));
    runStringTest(new UnsafeMemoryOutput(897));
View Full Code Here

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

    assertEquals(new byte[] { //
      11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, //
        31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, //
        51, 52, 53, 54, 55, 56, 57, 58, //
        61, 62, 63, 64, 65}, buffer.toBytes());
  }

  public void testStrings () throws IOException {
    runStringTest(new UnsafeOutput(4096));
    runStringTest(new UnsafeOutput(897));
View Full Code Here

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

    runStringTest(new UnsafeOutput(new ByteArrayOutputStream()));

    UnsafeOutput write = new UnsafeOutput(21);
    String value = "abcdef\u00E1\u00E9\u00ED\u00F3\u00FA\u1234";
    write.writeString(value);
    Input read = new UnsafeInput(write.toBytes());
    assertEquals(value, read.readString());

    runStringTest(127);
    runStringTest(256);
    runStringTest(1024 * 1023);
 
View Full Code Here

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

      buffer.append((char)i);

    String value = buffer.toString();
    write.writeString(value);
    write.writeString(value);
    Input read = new UnsafeInput(write.toBytes());
    assertEquals(value, read.readString());
    assertEquals(value, read.readStringBuilder().toString());

    write.clear();
    write.writeString(buffer);
View Full Code Here

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

    assertEquals(value, read.readStringBuilder().toString());

    write.clear();
    write.writeString(buffer);
    write.writeString(buffer);
    read = new UnsafeInput(write.toBytes());
    assertEquals(value, read.readStringBuilder().toString());
    assertEquals(value, read.readString());

    if (length <= 127) {
      write.clear();
View Full Code Here

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

    if (length <= 127) {
      write.clear();
      write.writeAscii(value);
      write.writeAscii(value);
      read = new UnsafeInput(write.toBytes());
      assertEquals(value, read.readStringBuilder().toString());
      assertEquals(value, read.readString());
    }
  }
View Full Code Here

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

  }

  public void testCanReadInt () throws IOException {
    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());
View Full Code Here

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

    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.toBytes()

  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.hp.hpl.jena.tdb.store.NodeId.toBytes()

            // Write the node, which allocates an id for it.
            NodeId id = writeNodeToTable(node) ;

            // Update the r record with the new id.
            // r.value := id bytes ;
            id.toBytes(r.getValue(), 0) ;

            // Put in index - may appear because of concurrency
            if ( ! nodeHashToId.add(r) )
                throw new TDBException("NodeTableBase::nodeToId - record mysteriously appeared") ;
            return id ;
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.