Package org.directmemory.memory

Examples of org.directmemory.memory.OffHeapMemoryBuffer.retrieve()


    logger.info("entries=" + howMany);
    String test = "this is a nicely crafted test";
    for (int i = 0; i < howMany; i++) {
      final byte[] payload = (test + " - " + i).getBytes();
      Pointer p = mem.store(payload);
      final byte[] check = mem.retrieve(p);
      assertNotNull(check);
      assertEquals(test + " - " + i, new String(check));
      long crc1 = OffHeapMemoryBuffer.crc32(payload);
      long crc2 = OffHeapMemoryBuffer.crc32(check);
      assertEquals(crc1, crc2);
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.