Package com.google.code.yanf4j.util

Examples of com.google.code.yanf4j.util.ByteBufferMatcher.matchFirst()


        "hello hel;lo".getBytes()).position(6)));
    assertEquals(-1, m.matchFirst(IoBuffer.wrap(
        "hello hel;lo".getBytes()).limit(6)));

    assertEquals(-1, m.matchFirst(null));
    assertEquals(-1, m.matchFirst(IoBuffer.allocate(0)));


    ByteBufferMatcher newline = new ShiftAndByteBufferMatcher(IoBuffer
        .wrap("\r\n".getBytes()));
View Full Code Here


    ByteBufferMatcher newline = new ShiftAndByteBufferMatcher(IoBuffer
        .wrap("\r\n".getBytes()));

    String memcachedGet = "VALUE test 0 0 100\r\nhello\r\n";
    assertEquals(memcachedGet.indexOf("\r\n"), newline
        .matchFirst(IoBuffer.wrap(memcachedGet.getBytes())));
    assertEquals(25, newline.matchFirst(IoBuffer.wrap(
        memcachedGet.getBytes()).position(20)));
  }
View Full Code Here

        .wrap("\r\n".getBytes()));

    String memcachedGet = "VALUE test 0 0 100\r\nhello\r\n";
    assertEquals(memcachedGet.indexOf("\r\n"), newline
        .matchFirst(IoBuffer.wrap(memcachedGet.getBytes())));
    assertEquals(25, newline.matchFirst(IoBuffer.wrap(
        memcachedGet.getBytes()).position(20)));
  }

  public abstract ByteBufferMatcher createByteBufferMatcher(String hello);
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.