Package java.io

Examples of java.io.PipedReader


     */
    public ParsingReader(
            Parser parser, InputStream stream, Metadata metadata,
            ParseContext context, Executor executor) throws IOException {
        this.parser = parser;
        PipedReader pipedReader = new PipedReader();
        this.reader = new BufferedReader(pipedReader);
        try {
            this.writer = new PipedWriter(pipedReader);
        } catch (IOException e) {
            throw new IllegalStateException(e); // Should never happen
View Full Code Here


     * can cause a deadlock.
     */
    public void testGetInfo() throws IOException {
        sysinfo_api_helper sah = new sysinfo_api_helper();
        sah.start();
        PipedReader pipeR = new PipedReader(sah.getPipedWriter());
        BufferedReader br = new BufferedReader(pipeR);
        assertEquals("------------------ Java Information ------------------",
                     br.readLine());
        br.close();
        pipeR.close();
    }
View Full Code Here

     *
     * @throws IOException DOCUMENT ME!
     */
    public Reader getReader() throws IOException {
        if (pipeIn == null) {
            pipeIn = new PipedReader();
            pipeOut = new PipedWriter(pipeIn);

            Thread thread = new ParserThread(this);
            thread.start(); // start parsing
        }
View Full Code Here

      fail("Unexpected: " + e);
    }
       
        //regression for HARMONY-831
        try{
            new BufferedReader(new PipedReader(), 9).read(new char[] {}, 7, 0);
            fail("should throw IndexOutOfBoundsException");
        }catch(IndexOutOfBoundsException e){
        }
       
        // Regression for HARMONY-54
View Full Code Here

     * can cause a deadlock.
     */
    public void testGetInfo() throws IOException {
        sysinfo_api_helper sah = new sysinfo_api_helper();
        sah.start();
        PipedReader pipeR = new PipedReader(sah.getPipedWriter());
        BufferedReader br = new BufferedReader(pipeR);
        assertEquals("------------------ Java Information ------------------",
                     br.readLine());
        br.close();
        pipeR.close();
    }
View Full Code Here

     * @throws RatReportFailedException
     */
    public static void report(Writer out, IReportable base, final InputStream style,
            final IHeaderMatcher matcher, final ILicenseFamily[] approvedLicenseNames)
                throws IOException, TransformerConfigurationException, FileNotFoundException, InterruptedException, RatReportFailedException {
        PipedReader reader = new PipedReader();
        PipedWriter writer = new PipedWriter(reader);
        ReportTransformer transformer = new ReportTransformer(out, style, reader);
        Thread transformerThread = new Thread(transformer);
        transformerThread.start();
        report(base, writer, matcher, approvedLicenseNames);
View Full Code Here

    /**
     * @tests java.io.PipedReader#PipedReader(java.io.PipedWriter)
     */
    public void test_ConstructorLjava_io_PipedWriter() throws IOException {
        // Test for method java.io.PipedReader(java.io.PipedWriter)
        preader = new PipedReader(new PipedWriter());
    }
View Full Code Here

     * @tests java.io.PipedReader#close()
     */
    public void test_close() throws Exception {
        // Test for method void java.io.PipedReader.close()
        char[] c = null;
        preader = new PipedReader();
        t = new Thread(new PWriter(preader), "");
        t.start();
        Thread.sleep(500); // Allow writer to start
        c = new char[11];
        preader.read(c, 0, 11);
View Full Code Here

     */
    public void test_connectLjava_io_PipedWriter() throws Exception {
        // Test for method void java.io.PipedReader.connect(java.io.PipedWriter)
        char[] c = null;

        preader = new PipedReader();
        t = new Thread(pwriter = new PWriter(), "");
        preader.connect(pwriter.pw);
        t.start();
        Thread.sleep(500); // Allow writer to start
        c = new char[11];
View Full Code Here

   * @tests java.io.PipedReader#read()
   */
  public void test_read() throws Exception {
        // Test for method int java.io.PipedReader.read()
        char[] c = null;
        preader = new PipedReader();
        t = new Thread(new PWriter(preader), "");
        t.start();
        Thread.sleep(500); // Allow writer to start
        c = new char[11];
        for (int i = 0; i < c.length; i++) {
View Full Code Here

TOP

Related Classes of java.io.PipedReader

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.