java/tsfile/src/main/java/org/apache/tsfile/encoding/encoder/DoubleRLBE.java [225:289]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          writeBit(true, out);
        } else {
          writeBit(false, out);
        }
      }
      j++;
    } while (lengRLE[j] == 0 && j <= writeIndex);
  }

  @Override
  public int getOneItemMaxSize() {
    return 4 * 4 * 2;
  }

  @Override
  public long getMaxByteSize() {
    return 5L * 4 * blockSize * 2;
  }

  /**
   * write one bit to byteBuffer, when byteBuffer is full, flush byteBuffer to output stream
   *
   * @param b the bit to be written
   * @param out output stream
   */
  protected void writeBit(boolean b, ByteArrayOutputStream out) {
    byteBuffer <<= 1;
    if (b) {
      byteBuffer |= 1;
    }

    numberLeftInBuffer++;
    if (numberLeftInBuffer == 8) {
      clearBuffer(out);
    }
  }

  /**
   * flush bits left in byteBuffer to output stream.
   *
   * @param out output stream
   */
  protected void clearBuffer(ByteArrayOutputStream out) {
    if (numberLeftInBuffer == 0) {
      return;
    }
    if (numberLeftInBuffer > 0) {
      byteBuffer <<= (8 - numberLeftInBuffer);
    }
    out.write(byteBuffer);
    numberLeftInBuffer = 0;
    byteBuffer = 0;
  }

  /**
   * write the number of encoded values to output stream
   *
   * @param out output stream
   */
  private void writewriteIndex(ByteArrayOutputStream out) {
    for (int i = 31; i >= 0; i--) {
      if ((writeIndex + 1 & (1 << i)) > 0) {
        writeBit(true, out);
      } else {
        writeBit(false, out);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



java/tsfile/src/main/java/org/apache/tsfile/encoding/encoder/LongRLBE.java [208:272]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
          writeBit(true, out);
        } else {
          writeBit(false, out);
        }
      }
      j++;
    } while (lengRLE[j] == 0 && j <= writeIndex);
  }

  @Override
  public int getOneItemMaxSize() {
    return 4 * 4 * 2;
  }

  @Override
  public long getMaxByteSize() {
    return 5L * 4 * blockSize * 2;
  }

  /**
   * write one bit to byteBuffer, when byteBuffer is full, flush byteBuffer to output stream.
   *
   * @param b the bit to be written
   * @param out output stream
   */
  protected void writeBit(boolean b, ByteArrayOutputStream out) {
    byteBuffer <<= 1;
    if (b) {
      byteBuffer |= 1;
    }

    numberLeftInBuffer++;
    if (numberLeftInBuffer == 8) {
      clearBuffer(out);
    }
  }

  /**
   * flush bits left in byteBuffer to output stream.
   *
   * @param out output stream
   */
  protected void clearBuffer(ByteArrayOutputStream out) {
    if (numberLeftInBuffer == 0) {
      return;
    }
    if (numberLeftInBuffer > 0) {
      byteBuffer <<= (8 - numberLeftInBuffer);
    }
    out.write(byteBuffer);
    numberLeftInBuffer = 0;
    byteBuffer = 0;
  }

  /**
   * write the number of encoded values to output stream.
   *
   * @param out output stream
   */
  private void writewriteIndex(ByteArrayOutputStream out) {
    for (int i = 31; i >= 0; i--) {
      if ((writeIndex + 1 & (1 << i)) > 0) {
        writeBit(true, out);
      } else {
        writeBit(false, out);
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



