private void doFlush(byte[][] toFlush,int len) throws IOException {
  int bidx=0, widx=0;
  ByteBuffer writevBufs[]=new ByteBuffer[2 * WRITEV_SIZE];
  while (true) {
    if (widx == writevBufs.length) {
      channel.write(writevBufs);
      widx=0;
    }
    if (bidx == len) {
      break;
    }
    writevBufs[widx]=ByteBuffer.wrap(toFlush[bidx]);
    writevBufs[widx + 1]=newlineBuf;
    bidx++;
    widx+=2;
  }
  if (widx > 0) {
    channel.write(writevBufs,0,widx);
  }
}

private void doFlush ( byte [ ] [ ] toFlush , int len ) throws IOException { int bidx = 0 , widx = 0 ; ByteBuffer writevBufs [ ] = new ByteBuffer [ 2 * WRITEV_SIZE ] ; while ( true ) { if ( widx == writevBufs . length ) { channel . write ( writevBufs ) ; widx = 0 ; } if ( bidx == len ) { break ; } writevBufs [ widx ] = ByteBuffer . wrap ( toFlush [ bidx ] ) ; writevBufs [ widx + 1 ] = newlineBuf ; bidx ++ ; widx += 2 ; } if ( widx > 0 ) { channel . write ( writevBufs , 0 , widx ) ; } }
flushes a bufferedspans array .
