question: private static void pipe ( InputStream source , OutputStream dest ) throws IOException { byte [ ] buf = new byte [ 1024 ] ; int read = 0 ; while ( ( read = source . read ( buf ) ) >= 0 ) { if ( null != dest ) dest . write ( buf , 0 , read ) ; } if ( null != dest ) dest . flush ( ) ; }
target:  Pipes everything from the source to the dest.  If dest is null,  then everything is read from source and thrown away.