Examples of byteAt()


Examples of org.apache.james.mime4j.util.ByteArrayBuffer.byteAt()

        byte[] b2 = buffer.toByteArray();
        assertNotNull(b2);
        assertEquals(4, b2.length);
        for (int i = 0; i < tmp.length; i++) {
            assertEquals(tmp[i], b2[i]);
            assertEquals(tmp[i], buffer.byteAt(i));
        }
        buffer.clear();
        assertEquals(16, buffer.capacity());
        assertEquals(0, buffer.length());
        assertTrue(buffer.isEmpty());
View Full Code Here

Examples of org.apache.james.mime4j.util.ByteArrayBuffer.byteAt()

        }
        assertEquals(8, buffer.capacity());
        assertEquals(6, buffer.length());

        for (int i = 0; i < tmp.length; i++) {
            assertEquals(tmp[i], buffer.byteAt(i));
        }
    }

    public void testSetLength() throws Exception {
        ByteArrayBuffer buffer = new ByteArrayBuffer(4);
View Full Code Here

Examples of org.apache.james.mime4j.util.ByteSequence.byteAt()

            }
            if (cursor.atEnd()) {
                break;
            } else {
                pos = cursor.getPos();
                if (buf.byteAt(pos) == COMMA) {
                    cursor.updatePos(pos + 1);
                }
            }
        }
    }
View Full Code Here

Examples of org.apache.james.mime4j.util.ByteSequence.byteAt()

            if (major < 0) {
                major = 0;
            }
        } catch (NumberFormatException ex) {
        }
        if (!cursor.atEnd() && buf.byteAt(cursor.getPos()) == FULL_STOP) {
            cursor.updatePos(cursor.getPos() + 1);
        }
        String token2 = parser.parseValue(buf, cursor, null);
        try {
            minor = Integer.parseInt(token2);
View Full Code Here

Examples of org.apache.james.mime4j.util.ByteSequence.byteAt()

        parser.copyContent(raw, cursor, RawFieldParser.INIT_BITSET(':'), strbuf1);

        Assert.assertFalse(cursor.atEnd());
        Assert.assertEquals(6, cursor.getPos());
        Assert.assertEquals("raw", strbuf1.toString());
        Assert.assertEquals(':', raw.byteAt(cursor.getPos()));
        cursor.updatePos(cursor.getPos() + 1);

        parser.skipWhiteSpace(raw, cursor);

        Assert.assertFalse(cursor.atEnd());
View Full Code Here

Examples of org.apache.james.mime4j.util.ByteSequence.byteAt()

        StringBuilder strbuf1 = new StringBuilder();
        parser.copyContent(raw, cursor, RawFieldParser.INIT_BITSET(':'), strbuf1);

        Assert.assertFalse(cursor.atEnd());
        Assert.assertEquals("raw", strbuf1.toString());
        Assert.assertEquals(':', raw.byteAt(cursor.getPos()));
        cursor.updatePos(cursor.getPos() + 1);

        parser.skipWhiteSpace(raw, cursor);

        Assert.assertFalse(cursor.atEnd());
View Full Code Here

Examples of org.apache.lucene.index.Payload.byteAt()

    assertEquals(expected, termAtt.term());
    Payload payload = payloadAtt.getPayload();
    if (payload != null) {
      assertTrue(payload.length() + " does not equal: " + expectPay.length, payload.length() == expectPay.length);
      for (int i = 0; i < expectPay.length; i++) {
        assertTrue(expectPay[i] + " does not equal: " + payload.byteAt(i), expectPay[i] == payload.byteAt(i));

      }
    } else {
      assertTrue("expectPay is not null and it should be", expectPay == null);
    }
View Full Code Here

Examples of org.apache.lucene.index.Payload.byteAt()

    assertEquals(expected, termAtt.term());
    Payload payload = payloadAtt.getPayload();
    if (payload != null) {
      assertTrue(payload.length() + " does not equal: " + expectPay.length, payload.length() == expectPay.length);
      for (int i = 0; i < expectPay.length; i++) {
        assertTrue(expectPay[i] + " does not equal: " + payload.byteAt(i), expectPay[i] == payload.byteAt(i));

      }
    } else {
      assertTrue("expectPay is not null and it should be", expectPay == null);
    }
View Full Code Here

Examples of org.apache.lucene.index.Payload.byteAt()

    assertEquals(expected, termAtt.term());
    Payload payload = payAtt.getPayload();
    if (payload != null) {
      assertTrue(payload.length() + " does not equal: " + expectPay.length, payload.length() == expectPay.length);
      for (int i = 0; i < expectPay.length; i++) {
        assertTrue(expectPay[i] + " does not equal: " + payload.byteAt(i), expectPay[i] == payload.byteAt(i));

      }
    } else {
      assertTrue("expectPay is not null and it should be", expectPay == null);
    }
View Full Code Here

Examples of org.apache.lucene.index.Payload.byteAt()

    assertEquals(expected, termAtt.term());
    Payload payload = payAtt.getPayload();
    if (payload != null) {
      assertTrue(payload.length() + " does not equal: " + expectPay.length, payload.length() == expectPay.length);
      for (int i = 0; i < expectPay.length; i++) {
        assertTrue(expectPay[i] + " does not equal: " + payload.byteAt(i), expectPay[i] == payload.byteAt(i));

      }
    } else {
      assertTrue("expectPay is not null and it should be", expectPay == null);
    }
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.