Package java.io

Examples of java.io.BufferedReader.reset()


    in = new BufferedReader(new Support_StringReader(new String(chars)), 12);
    in.skip(6);
    in.mark(8);
    in.skip(7);
    in.reset();
    assertTrue("Wrong chars 2", in.read() == (char) 6
        && in.read() == (char) 7);
   
        BufferedReader br = new BufferedReader(new StringReader("01234"), 2);
        br.mark(3);
View Full Code Here


        while(in.ready())
        {
            pw.println(in.readLine());
        }

        try { in.reset() ;} catch (IOException e) { System.out.println("DumpServlet: Reset of content failed: "+e) ; }
    }
   
    /**
     * <code>dumpEnvironment</code>
     * @return String that is the HTML of the System properties as
View Full Code Here

        chars)), 12);

    in.skip(6);
    in.mark(14);
    in.read(new char[14], 0, 14);
    in.reset();
    assertTrue("Wrong chars", in.read() == (char) 6
        && in.read() == (char) 7);

    in = new BufferedReader(new Support_StringReader(new String(chars)), 12);
    in.skip(6);
View Full Code Here

    in = new BufferedReader(new Support_StringReader(new String(chars)), 12);
    in.skip(6);
    in.mark(8);
    in.skip(7);
    in.reset();
    assertTrue("Wrong chars 2", in.read() == (char) 6
        && in.read() == (char) 7);
   
        BufferedReader br = new BufferedReader(new StringReader("01234"), 2);
        br.mark(3);
View Full Code Here

            }
            Matcher wtMatcher = WRONG_TOKEN.matcher(line);
            if (wtMatcher.matches()) {
                throw new WrongSybosTokenException(wtMatcher.group(1));
            }
            reader.reset();

            Document d = db.parse(new InputSource(reader));
            return d;
        } catch (ParserConfigurationException e) {
            throw new RuntimeException(e);
View Full Code Here

        chars)), 12);

    in.skip(6);
    in.mark(14);
    in.read(new char[14], 0, 14);
    in.reset();
    assertTrue("Wrong chars", in.read() == (char) 6
        && in.read() == (char) 7);

    in = new BufferedReader(new Support_StringReader(new String(chars)), 12);
    in.skip(6);
View Full Code Here

    in = new BufferedReader(new Support_StringReader(new String(chars)), 12);
    in.skip(6);
    in.mark(8);
    in.skip(7);
    in.reset();
    assertTrue("Wrong chars 2", in.read() == (char) 6
        && in.read() == (char) 7);
   
        BufferedReader br = new BufferedReader(new StringReader("01234"), 2);
        br.mark(3);
View Full Code Here

            x = x.replaceAll("&", "&amp;") ;
            x = x.replaceAll("<", "&lt;") ;
            x = x.replaceAll(">", "&gt;") ;
            pw.println(x) ;
        }
        try { in.reset() ;} catch (IOException e) { System.out.println("DumpServlet: Reset of content failed: "+e) ; }
    }
   
    /**
     * <code>dumpEnvironment</code>
     * @return String that is the HTML of the System properties as
View Full Code Here

    @SuppressWarnings("resource")
    BufferedReader reader = factory.create(new ByteArrayResource("a||b||c".getBytes()), "UTF-8");
    assertEquals("a", reader.readLine());
    reader.mark(1024);
    assertEquals("b", reader.readLine());
    reader.reset();
    assertEquals("b", reader.readLine());
    assertEquals("c", reader.readLine());
    assertEquals(null, reader.readLine());
  }
View Full Code Here

        }
        BufferedReader reader = new BufferedReader(new StringReader(sb.toString()), 100);
        reader.skip(50);
        reader.mark(70);
        reader.skip(60);
        reader.reset();
        char[] buffer = new char[150];
        int charsRead = reader.read(buffer);
        assertEquals(150, charsRead);
        assertEquals(50, buffer[0]);
        assertEquals(51, buffer[1]);
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.