public void writeTo ( final OutputStream out ) throws IOException { for ( int i = 0 ; i <= index ; i ++ ) { Block block = blocks . get ( i ) ; out . write ( block . data , 0 , block . limit ) ; } }
Write the entire buffer to output stream .