Package java.io

Examples of java.io.PipedWriter


      }

      public Object content( final int field ) throws IOException {
        ensureFieldIndex( field );
        pipedReader = new PipedReader();
        pipedWriter = new PipedWriter();
        pdfDocument = PDDocument.load( rawContent );
        pipedWriter.connect( pipedReader );
        pipingThread = new Thread() {
          public void run() {
            try {
View Full Code Here


  }
  public void createSession(String name) {
    try {
      ServiceReference srl = Activator.bc.getServiceReference(ConsoleService.class.getName());
      ConsoleService console = (ConsoleService) Activator.bc.getService(srl);
      PipedWriter pipeToConsole = new PipedWriter();
      Reader consoleIn = new PipedReader(pipeToConsole);
      toConsole = new PrintWriter(pipeToConsole);

      PipedReader pipeFromConsole = new PipedReader();
      PrintWriter consoleOut = new PrintWriter(new PipedWriter(pipeFromConsole));
      fromConsole = pipeFromConsole;
      consoleSession = console.runSession(name, consoleIn, consoleOut);
    } catch (Exception e) {}
  }
View Full Code Here

            int scriptIndex = 0;

            if (sqlText != null) {
                try {
                    tmpReader = new PipedReader();
                    PipedWriter tmpWriter = new PipedWriter(tmpReader);
                    // My best guess is that the encoding here will be however
                    // we read the SQL text from the command-line, which will
                    // be the platform default encoding.  Therefore, don't
                    // specify an encoding for this pipe.
                    try {
                        tmpWriter.write(sqlText + LS);
                        tmpWriter.flush();
                    } finally {
                        try {
                            tmpWriter.close();
                        } finally {
                            tmpWriter = null// Encourage GC of buffers
                        }
                    }
                } catch (IOException ioe) {
View Full Code Here

     *
     * @throws IOException
     */
    @Test
    public void testGetOneLineOneParser() throws IOException {
        final PipedWriter writer = new PipedWriter();
        final PipedReader reader = new PipedReader(writer);
        final CSVFormat format = CSVFormat.DEFAULT;
        final CSVParser parser = new CSVParser(reader, format);
        try {
            writer.append(CSV_INPUT_1);
            writer.append(format.getRecordSeparator());
            final CSVRecord record1 = parser.nextRecord();
            assertArrayEquals(RESULT[0], record1.values());
            writer.append(CSV_INPUT_2);
            writer.append(format.getRecordSeparator());
            final CSVRecord record2 = parser.nextRecord();
            assertArrayEquals(RESULT[1], record2.values());
        } finally {
            parser.close();
        }
View Full Code Here

        pageHeight = console.getDeviceHeight() - 1;
        pageWidth = console.getDeviceWidth();
        pageSize = pageHeight * pageWidth;
        tabSize = console.getTabSize();
       
        pw = new PipedWriter();
        pr = new PipedReader();
        pr.connect(pw);
       
        console.addKeyboardListener(this);
    }
View Full Code Here

            int scriptIndex = 0;

            if (sqlText != null) {
                try {
                    tmpReader = new PipedReader();
                    PipedWriter tmpWriter = new PipedWriter(tmpReader);
                    // My best guess is that the encoding here will be however
                    // we read the SQL text from the command-line, which will
                    // be the platform default encoding.  Therefore, don't
                    // specify an encoding for this pipe.
                    try {
                        tmpWriter.write(sqlText + LS);
                        tmpWriter.flush();
                    } finally {
                        try {
                            tmpWriter.close();
                        } finally {
                            tmpWriter = null// Encourage GC of buffers
                        }
                    }
                } catch (IOException ioe) {
View Full Code Here

    }

   
    protected void setUp() throws IOException {
        PipedReader pin = new PipedReader();
        out = new PipedWriter(pin);
        in = new BufferedReader(pin);
        actualResult = 0;
        builder =  new Builder(new MinimizingFactory());
        generator = new Generator();
        generator.start();
View Full Code Here

            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
        }
        this.stream = stream;
        this.metadata = metadata;
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

     */
    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);
        writer.flush();
        writer.close();
        transformerThread.join();
    }
View Full Code Here

TOP

Related Classes of java.io.PipedWriter

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.