public void writeTo ( File file ) throws IOException { FileChannel channel = new FileOutputStream ( file ) . getChannel ( ) ; try { writeTo ( channel ) ; } finally { channel . close ( ) ; } }
Dump the buffer contents to a file