Package org.apache.james.mime4j.io

Examples of org.apache.james.mime4j.io.BufferedLineReaderInputStream.indexOf()


            inbuffer.indexOf(b2, 2, -1);
            fail("IndexOutOfBoundsException should have been thrown");
        } catch (IndexOutOfBoundsException expected) {
        }
        try {
            inbuffer.indexOf(b2, 2, 18);
            fail("IndexOutOfBoundsException should have been thrown");
        } catch (IndexOutOfBoundsException expected) {
        }
        assertEquals(5, inbuffer.indexOf(b2, 2, 17));
        try {
View Full Code Here


        try {
            inbuffer.indexOf(b2, 2, 18);
            fail("IndexOutOfBoundsException should have been thrown");
        } catch (IndexOutOfBoundsException expected) {
        }
        assertEquals(5, inbuffer.indexOf(b2, 2, 17));
        try {
            inbuffer.indexOf((byte)' ', -1, 3);
            fail("IndexOutOfBoundsException should have been thrown");
        } catch (IndexOutOfBoundsException expected) {
        }
View Full Code Here

            fail("IndexOutOfBoundsException should have been thrown");
        } catch (IndexOutOfBoundsException expected) {
        }
        assertEquals(5, inbuffer.indexOf(b2, 2, 17));
        try {
            inbuffer.indexOf((byte)' ', -1, 3);
            fail("IndexOutOfBoundsException should have been thrown");
        } catch (IndexOutOfBoundsException expected) {
        }
        try {
            inbuffer.indexOf((byte)' ', 1, 3);
View Full Code Here

            inbuffer.indexOf((byte)' ', -1, 3);
            fail("IndexOutOfBoundsException should have been thrown");
        } catch (IndexOutOfBoundsException expected) {
        }
        try {
            inbuffer.indexOf((byte)' ', 1, 3);
            fail("IndexOutOfBoundsException should have been thrown");
        } catch (IndexOutOfBoundsException expected) {
        }
        try {
            inbuffer.indexOf((byte)' ', 2, -1);
View Full Code Here

            inbuffer.indexOf((byte)' ', 1, 3);
            fail("IndexOutOfBoundsException should have been thrown");
        } catch (IndexOutOfBoundsException expected) {
        }
        try {
            inbuffer.indexOf((byte)' ', 2, -1);
            fail("IndexOutOfBoundsException should have been thrown");
        } catch (IndexOutOfBoundsException expected) {
        }
        try {
            inbuffer.indexOf((byte)' ', 2, 18);
View Full Code Here

            inbuffer.indexOf((byte)' ', 2, -1);
            fail("IndexOutOfBoundsException should have been thrown");
        } catch (IndexOutOfBoundsException expected) {
        }
        try {
            inbuffer.indexOf((byte)' ', 2, 18);
            fail("IndexOutOfBoundsException should have been thrown");
        } catch (IndexOutOfBoundsException expected) {
        }
        assertEquals(10, inbuffer.indexOf((byte)'y', 2, 17));
    }
View Full Code Here

        try {
            inbuffer.indexOf((byte)' ', 2, 18);
            fail("IndexOutOfBoundsException should have been thrown");
        } catch (IndexOutOfBoundsException expected) {
        }
        assertEquals(10, inbuffer.indexOf((byte)'y', 2, 17));
    }
     
    public void testBasicOperations() throws Exception {
        String text = "bla bla yada yada haha haha";
        byte[] b1 = text.getBytes("US-ASCII");
View Full Code Here

        String pattern = "d";
        byte[] b1 = text.getBytes("US-ASCII");
        byte[] b2 = pattern.getBytes("US-ASCII");
        BufferedLineReaderInputStream inbuffer = new BufferedLineReaderInputStream(new ByteArrayInputStream(b1), 4096);
        inbuffer.fillBuffer();
        int i = inbuffer.indexOf(b2);
        assertEquals(7, i);
    }
   
    public void testPatternMatching2() throws Exception {
        String text = "disddisdissdsidsidsiid";
View Full Code Here

        String pattern = "siid";
        byte[] b1 = text.getBytes("US-ASCII");
        byte[] b2 = pattern.getBytes("US-ASCII");
        BufferedLineReaderInputStream inbuffer = new BufferedLineReaderInputStream(new ByteArrayInputStream(b1), 4096);
        inbuffer.fillBuffer();
        int i = inbuffer.indexOf(b2);
        assertEquals(18, i);
    }
   
    public void testPatternMatching3() throws Exception {
        String text = "bla bla yada yada haha haha";
View Full Code Here

        String pattern = "blah";
        byte[] b1 = text.getBytes("US-ASCII");
        byte[] b2 = pattern.getBytes("US-ASCII");
        BufferedLineReaderInputStream inbuffer = new BufferedLineReaderInputStream(new ByteArrayInputStream(b1), 4096);
        inbuffer.fillBuffer();
        int i = inbuffer.indexOf(b2);
        assertEquals(-1, i);
    }
   
    public void testPatternMatching4() throws Exception {
        String text = "bla bla yada yada haha haha";
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.