List of usage examples for java.io PipedReader PipedReader
public PipedReader(PipedWriter src, int pipeSize) throws IOException
PipedReader
so that it is connected to the piped writer src
and uses the specified pipe size for the pipe's buffer. From source file:Main.java
public static void main(String[] args) { try {//from w w w . j a va 2s .c o m PipedWriter writer = new PipedWriter(); PipedReader reader = new PipedReader(writer, 100); // connect the reader and the writer reader.connect(writer); writer.write(70); writer.write(71); // check if reader is ready to read System.out.println(reader.ready()); // print the char array for (int i = 0; i < 2; i++) { System.out.println("" + (char) reader.read()); } reader.close(); } catch (Exception ex) { ex.printStackTrace(); } }
From source file:com.github.jferard.pgloaderutils.loader.CSVCleanerFileReader.java
public CSVCleanerFileReader(CSVParser parser, CSVRecordCleaner recordCleaner) throws IOException { this.recordCleaner = recordCleaner; PipedWriter pipedWriter = new PipedWriter(); this.modifiedStreamReader = new PipedReader(pipedWriter, BUFFER_SIZE); this.parser = parser; this.printer = new CSVPrinter(pipedWriter, CSVFormat.RFC4180); this.logger = Logger.getLogger("Cleaner"); }