protected void writeBitMaps(IWALByteBufferView buffer, List<int[]> rangeList, int rowNumInRange) {
    buffer.put(BytesUtils.boolToByte(bitMaps != null));
    if (bitMaps != null) {
      for (int i = 0; i < bitMaps.length; i++) {
        // ignore failed partial insert
        if (measurements[i] == null) {
          continue;
        }

        if (bitMaps[i] == null) {
          buffer.put(BytesUtils.boolToByte(false));
        } else {
          buffer.put(BytesUtils.boolToByte(true));
          BitMap partBitMap = new BitMap(rowNumInRange);
          int copiedLength = 0;
          for (int[] startEnd : rangeList) {
            int len = startEnd[1] - startEnd[0];
            BitMap.copyOfRange(bitMaps[i], startEnd[0], partBitMap, copiedLength, len);
            copiedLength += len;
          }
          buffer.put(partBitMap.getByteArray());
        }
      }
    }
  }
Serialize bitmaps, ignoring failed time series
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/queryengine/plan/planner/plan/node/write/InsertTabletNode.java