private static void doWithInt32Column(
      int rowCount,
      Column column,
      int[] bitmaps,
      int columnIndex,
      DataOutputStream dataOutputStream,
      int[] valueOccupation,
      DataOutputStream dataBitmapOutputStream)
      throws IOException {
    for (int i = 0, size = column.getPositionCount(); i < size; i++) {
      rowCount++;
      if (column.isNull(i)) {
        bitmaps[columnIndex] = bitmaps[columnIndex] << 1;
      } else {
        bitmaps[columnIndex] = (bitmaps[columnIndex] << 1) | FLAG;
        dataOutputStream.writeInt(column.getInt(i));
        valueOccupation[columnIndex] += 4;
      }
      if (rowCount != 0 && rowCount % 8 == 0) {
        dataBitmapOutputStream.writeByte(bitmaps[columnIndex]);
        // we should clear the bitmap every 8 points
        bitmaps[columnIndex] = 0;
      }
    }
  }
TimeValuePairUtils to convert between thrift format and TsFile format.
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/utils/QueryDataSetUtils.java