Package com.google.code.yanf4j.util

Examples of com.google.code.yanf4j.util.ShiftAndByteBufferMatcher


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


    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


import com.google.code.yanf4j.util.ShiftAndByteBufferMatcher;

public class ShiftAndByteBufferMatcherTest  extends ByteBufferMatcherTest {
  @Override
  public ByteBufferMatcher createByteBufferMatcher(String hello) {
    ByteBufferMatcher m = new ShiftAndByteBufferMatcher(IoBuffer.wrap(hello
        .getBytes()));
    return m;
  }
View Full Code Here

TOP

Related Classes of com.google.code.yanf4j.util.ShiftAndByteBufferMatcher

Copyright © 2018 www.massapicom. 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.