public void writeTo(final OutputStream out) throws IOException {
  for (  final Block block : blocks) {
    out.write(block.data,0,block.limit);
  }
}

public void writeTo ( final OutputStream out ) throws IOException { for ( final Block block : blocks ) { out . write ( block . data , 0 , block . limit ) ; } }
write the entire buffer to output stream .
