Package org.apache.abdera.i18n.text.io

Examples of org.apache.abdera.i18n.text.io.FilteredCharReader


    }

    @Test
    public void testFilteredCharReader() throws Exception {
        String string = "abcdefg";
        FilteredCharReader fcr = new FilteredCharReader(new StringReader(string), new Filter() {
            public boolean accept(int c) {
                return c != 'c' && c != 'd' && c != 'e';
            }
        });
        char[] buf = new char[7];
        int r = fcr.read(buf);
        assertEquals(4, r);
        assertEquals("abfg", new String(buf, 0, r));
    }
View Full Code Here


  }
 
  @Test
  public void testFilteredCharReader() throws Exception {
    String string = "abcdefg";
    FilteredCharReader fcr =
      new FilteredCharReader(
        new StringReader(string),
        new Filter() {
          public boolean accept(int c) {
            return c != 'c' &&
                   c != 'd' &&
                   c != 'e';
          }});
    char[] buf = new char[7];
    int r = fcr.read(buf);
    assertEquals(r,4);
    assertEquals(new String(buf,0,r),"abfg");
  }
View Full Code Here

TOP

Related Classes of org.apache.abdera.i18n.text.io.FilteredCharReader

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.