// // read from file, echo to standard output // replace new lines with spaces // // uses CensorInputStream // import java.io.FileInputStream; import java.io.InputStream; import java.io.IOException; public class RemoveReturns { public static void main( String [] args ) throws IOException { InputStream file = new FileInputStream( args[0] ); InputStream source = new CensorInputStream( file, '\n', ' ' ); int nextCharacter; while ( true ) { nextCharacter = source.read(); if ( nextCharacter == -1 ) break; System.out.print( (char) nextCharacter ); } } }