Examples of matchFirst()


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

public abstract class ByteBufferMatcherTest extends TestCase {
  public void testMatchFirst() {
    String hello = "hel;lo";
    ByteBufferMatcher m = createByteBufferMatcher(hello);
    assertEquals(0, m.matchFirst(IoBuffer.wrap("hel;lo".getBytes())));
    assertEquals(-1, m.matchFirst(IoBuffer.wrap("hel;l0".getBytes())));
    assertEquals(6, m
        .matchFirst(IoBuffer.wrap("hello hel;lo".getBytes())));
    assertEquals(0, (m.matchFirst(IoBuffer
        .wrap("hel;lo good ".getBytes()))));
View Full Code Here

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

public abstract class ByteBufferMatcherTest extends TestCase {
  public void testMatchFirst() {
    String hello = "hel;lo";
    ByteBufferMatcher m = createByteBufferMatcher(hello);
    assertEquals(0, m.matchFirst(IoBuffer.wrap("hel;lo".getBytes())));
    assertEquals(-1, m.matchFirst(IoBuffer.wrap("hel;l0".getBytes())));
    assertEquals(6, m
        .matchFirst(IoBuffer.wrap("hello hel;lo".getBytes())));
    assertEquals(0, (m.matchFirst(IoBuffer
        .wrap("hel;lo good ".getBytes()))));
    assertEquals(7, m.matchFirst(IoBuffer.wrap("abcdefghel;lo good "
View Full Code Here

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

  public void testMatchFirst() {
    String hello = "hel;lo";
    ByteBufferMatcher m = createByteBufferMatcher(hello);
    assertEquals(0, m.matchFirst(IoBuffer.wrap("hel;lo".getBytes())));
    assertEquals(-1, m.matchFirst(IoBuffer.wrap("hel;l0".getBytes())));
    assertEquals(6, m
        .matchFirst(IoBuffer.wrap("hello hel;lo".getBytes())));
    assertEquals(0, (m.matchFirst(IoBuffer
        .wrap("hel;lo good ".getBytes()))));
    assertEquals(7, m.matchFirst(IoBuffer.wrap("abcdefghel;lo good "
        .getBytes())));
View Full Code Here

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

    ByteBufferMatcher m = createByteBufferMatcher(hello);
    assertEquals(0, m.matchFirst(IoBuffer.wrap("hel;lo".getBytes())));
    assertEquals(-1, m.matchFirst(IoBuffer.wrap("hel;l0".getBytes())));
    assertEquals(6, m
        .matchFirst(IoBuffer.wrap("hello hel;lo".getBytes())));
    assertEquals(0, (m.matchFirst(IoBuffer
        .wrap("hel;lo good ".getBytes()))));
    assertEquals(7, m.matchFirst(IoBuffer.wrap("abcdefghel;lo good "
        .getBytes())));
    assertEquals(-1, m.matchFirst(IoBuffer.wrap("".getBytes())));
View Full Code Here

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

    assertEquals(-1, m.matchFirst(IoBuffer.wrap("hel;l0".getBytes())));
    assertEquals(6, m
        .matchFirst(IoBuffer.wrap("hello hel;lo".getBytes())));
    assertEquals(0, (m.matchFirst(IoBuffer
        .wrap("hel;lo good ".getBytes()))));
    assertEquals(7, m.matchFirst(IoBuffer.wrap("abcdefghel;lo good "
        .getBytes())));
    assertEquals(-1, m.matchFirst(IoBuffer.wrap("".getBytes())));

    assertEquals(6, m.matchFirst(IoBuffer.wrap(
        "hello hel;lo".getBytes()).position(4)));
View Full Code Here

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

        .matchFirst(IoBuffer.wrap("hello hel;lo".getBytes())));
    assertEquals(0, (m.matchFirst(IoBuffer
        .wrap("hel;lo good ".getBytes()))));
    assertEquals(7, m.matchFirst(IoBuffer.wrap("abcdefghel;lo good "
        .getBytes())));
    assertEquals(-1, m.matchFirst(IoBuffer.wrap("".getBytes())));

    assertEquals(6, m.matchFirst(IoBuffer.wrap(
        "hello hel;lo".getBytes()).position(4)));
    assertEquals(6, m.matchFirst(IoBuffer.wrap(
        "hello hel;lo".getBytes()).position(6)));
View Full Code Here

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

        .wrap("hel;lo good ".getBytes()))));
    assertEquals(7, m.matchFirst(IoBuffer.wrap("abcdefghel;lo good "
        .getBytes())));
    assertEquals(-1, m.matchFirst(IoBuffer.wrap("".getBytes())));

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

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

        .getBytes())));
    assertEquals(-1, m.matchFirst(IoBuffer.wrap("".getBytes())));

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

    assertEquals(-1, m.matchFirst(null));
View Full Code Here

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

    assertEquals(6, m.matchFirst(IoBuffer.wrap(
        "hello hel;lo".getBytes()).position(4)));
    assertEquals(6, m.matchFirst(IoBuffer.wrap(
        "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)));
View Full Code Here

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

    assertEquals(6, m.matchFirst(IoBuffer.wrap(
        "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
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.