Package net.rubyeye.xmemcached.buffer

Examples of net.rubyeye.xmemcached.buffer.IoBuffer.capacity()


  public void testEmptyBuffer() {
    IoBuffer emptyBuffer = this.allocator.allocate(0);

    assertNotNull(emptyBuffer);
    assertEquals(0, emptyBuffer.capacity());
    assertEquals(0, emptyBuffer.position());
    assertEquals(0, emptyBuffer.limit());

    try {
      emptyBuffer.put((byte) 0);
View Full Code Here


    IoBuffer buffer = this.allocator.allocate(64);
    assertNotNull(buffer);
    assertEquals(ByteOrder.BIG_ENDIAN, buffer.order());
    assertNotNull(buffer.getByteBuffer());

    assertEquals(64, buffer.capacity());
    assertEquals(0, buffer.position());
    assertEquals(64, buffer.limit());

    buffer.put("test".getBytes());
    assertEquals(64, buffer.capacity());
View Full Code Here

    assertEquals(64, buffer.capacity());
    assertEquals(0, buffer.position());
    assertEquals(64, buffer.limit());

    buffer.put("test".getBytes());
    assertEquals(64, buffer.capacity());
    assertEquals(4, buffer.position());
    assertEquals(64, buffer.limit());
    assertEquals(60, buffer.remaining());
    buffer.mark();
View Full Code Here

    assertEquals(0, buffer.position());
    assertEquals(4, buffer.limit());
    assertEquals(4, buffer.remaining());
   
    buffer.clear();
    assertEquals(64, buffer.capacity());
    assertEquals(0, buffer.position());
    assertEquals(64, buffer.limit());

    buffer.free();
    assertNull(buffer.getByteBuffer());
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.