@Override
  public int write(FileChannel channel, long offset) throws IOException {
    checkRefCount();
    int total = 0;
    while (buffsIterator.hasNext()) {
      ByteBuffer buffer = buffsIterator.next();
      while (buffer.hasRemaining()) {
        int len = channel.write(buffer, offset);
        total += len;
        offset += len;
      }
    }
    return total;
  }
Copy the content from this MBB to a byte[] based on the given offset and length the position
from where the copy should start the length upto which the copy has to be done
@return byte[] with the copied contents from this MBB.
hbase-common/src/main/java/org/apache/hadoop/hbase/nio/MultiByteBuff.java