Package java.io

Examples of java.io.CharArrayReader


    /**
     * @tests java.io.StreamTokenizer#slashStarComments(boolean)
     */
    public void test_slashStarComments_withSTClosed() throws IOException {
        Reader reader = new CharArrayReader( "t /* t */ t".toCharArray());

        StreamTokenizer st = new StreamTokenizer(reader);
        st.slashStarComments(false);

        assertEquals(StreamTokenizer.TT_WORD,st.nextToken());
View Full Code Here


    } catch (IOException e) {
      fail("Exception during read test 2:" + e);
    }
   
    // regression test for HARMONY-841
    assertTrue(new BufferedReader(new CharArrayReader(new char[5], 1, 0), 2).read() == -1);
  }
View Full Code Here

        assertNull(rs.getCharacterStream(1));
        assertTrue(rs.wasNull());
        assertNull(rs.getCharacterStream("column"));
        assertTrue(rs.wasNull());
        // Set what gets returned to something other than the default
        Reader reader = new CharArrayReader("this is a string".toCharArray());
        rs2.setNullCharacterStream(reader);
        assertNotNull(rs.getCharacterStream(1));
        assertEquals(reader, rs.getCharacterStream(1));
        assertNotNull(rs.getCharacterStream("column"));
        assertEquals(reader, rs.getCharacterStream("column"));
View Full Code Here

     */
    public void testSetNullCharacterStream() throws SQLException {

        assertNull(rs2.getNullCharacterStream());
        // Set what gets returned to something other than the default
        Reader reader = new CharArrayReader("this is a string".toCharArray());
        rs2.setNullCharacterStream(reader);
        assertNotNull(rs.getCharacterStream(1));
        assertEquals(reader, rs.getCharacterStream(1));
        assertNotNull(rs.getCharacterStream("column"));
        assertEquals(reader, rs.getCharacterStream("column"));
View Full Code Here

      return new BufferingServletOutputStream(outStream);
    }
   
    public Reader getReader() {
      if (output == null) return null;
      return new CharArrayReader(output.toCharArray());
    }
View Full Code Here

     * etc in this stream.
     *
     * @returns the value of this BodyJspWriter as a Reader
     */
    public Reader getReader() {
        return new CharArrayReader (cb, 0, nextChar);
    }
View Full Code Here

     * Tests if you can leave field values empty
     */
    public void testEmptyFieldValues()
    {
        String values = "field1\tfield2\tfield3\tfield4\nvalue11\t\tvalue13\t\nvalue21\t\tvalue23\t";
        CharArrayReader reader = new CharArrayReader(values.toCharArray());
        TSVParser parser = new TSVParser(reader);
        StringBuffer sb = new StringBuffer();
        try
        {
            parser.readColumnNames();
View Full Code Here

     * Tests if normal operation is still working
     */
    public void testNormalFieldValues()
    {
        String values = "field1\tfield2\tfield3\tfield4\nvalue11\tvalue12\tvalue13\tvalue14\nvalue21\tvalue22\tvalue23\tvalue24";
        CharArrayReader reader = new CharArrayReader(values.toCharArray());
        TSVParser parser = new TSVParser(reader);
        StringBuffer sb = new StringBuffer();
        try
        {
            parser.readColumnNames();
View Full Code Here

     * Tests if some fields are empty, but the values exists..
     */
    public void testEmptyFieldNames()
    {
        String values = "field1\t\tfield3\t\nvalue11\tvalue12\tvalue13\tvalue14\tvalue21\tvalue22\tvalue23\tvalue24";
        CharArrayReader reader = new CharArrayReader(values.toCharArray());
        TSVParser parser = new TSVParser(reader);
        StringBuffer sb = new StringBuffer();
        try
        {
            parser.readColumnNames();
View Full Code Here

     * Tests if you can leave field values empty
     */
    public void testEmptyFieldValues()
    {
        String values = "field1,field2,field3,field4\nvalue11,,value13,\nvalue21,,value23,";
        CharArrayReader reader = new CharArrayReader(values.toCharArray());
        CSVParser parser = new CSVParser(reader);
        StringBuffer sb = new StringBuffer();
        try
        {
            parser.readColumnNames();
View Full Code Here

TOP

Related Classes of java.io.CharArrayReader

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.