public static void writeFamily(OutputStream out, Cell cell, byte flength) throws IOException {
    if (cell instanceof ByteBufferExtendedCell) {
      ByteBufferUtils.copyBufferToStream(out, ((ByteBufferExtendedCell) cell).getFamilyByteBuffer(),
        ((ByteBufferExtendedCell) cell).getFamilyPosition(), flength);
    } else {
      out.write(cell.getFamilyArray(), cell.getFamilyOffset(), flength);
    }
  }
Writes the family from the given cell to the output stream
@param out     The outputstream to which the data has to be written
@param cell    The cell whose contents has to be written
@param flength the family length
hbase-common/src/main/java/org/apache/hadoop/hbase/PrivateCellUtil.java