Package com.esotericsoftware.kryo.io

Examples of com.esotericsoftware.kryo.io.UnsafeMemoryInput.readLong()


    assertEquals(-1048576, read.readLong(false));
    assertEquals(-1048576, read.readLong(true));
    assertEquals(-134217728, read.readLong(false));
    assertEquals(-134217728, read.readLong(true));
    assertEquals(-134217729, read.readLong(false));
    assertEquals(-134217729, read.readLong(true));

    Random random = new Random();
    for (int i = 0; i < 10000; i++) {
      long value = random.nextLong();
      write.clear();
View Full Code Here


      write.clear();
      write.writeLong(value);
      write.writeLong(value, true);
      write.writeLong(value, false);
      read.setBuffer(write.toBytes());
      assertEquals("Element " + i, value, read.readLong());
      assertEquals("Element " + i, value, read.readLong(true));
      assertEquals("Element " + i, value, read.readLong(false));
    }
  }
View Full Code Here

      write.writeLong(value);
      write.writeLong(value, true);
      write.writeLong(value, false);
      read.setBuffer(write.toBytes());
      assertEquals("Element " + i, value, read.readLong());
      assertEquals("Element " + i, value, read.readLong(true));
      assertEquals("Element " + i, value, read.readLong(false));
    }
  }

  public void testShorts () throws IOException {
View Full Code Here

      write.writeLong(value, true);
      write.writeLong(value, false);
      read.setBuffer(write.toBytes());
      assertEquals("Element " + i, value, read.readLong());
      assertEquals("Element " + i, value, read.readLong(true));
      assertEquals("Element " + i, value, read.readLong(false));
    }
  }

  public void testShorts () throws IOException {
    runShortTest(new UnsafeMemoryOutput(4096));
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.