private void skipTillEnough(final InputStream inputStream, final long length)
      throws IOException, PipeConnectionException {
    long currentSkippedBytes = 0;
    while (currentSkippedBytes < length) {
      final long skippedBytes = inputStream.skip(length - currentSkippedBytes);
      // In socket input stream skippedBytes == 0 indicates EOF, namely the
      // socket is closed
      if (skippedBytes == 0) {
        throw new PipeConnectionException("Socket closed when executing skipTillEnough.");
      }
      currentSkippedBytes += skippedBytes;
    }
  }
Skip given number of bytes of the buffer until enough bytes is skipped.

@param inputStream the input socket stream
@param length the length to skip
@throws IOException if any IOException occurs
@throws PipeConnectionException if the socket is closed during skipping
iotdb-core/datanode/src/main/java/org/apache/iotdb/db/pipe/receiver/protocol/airgap/IoTDBAirGapReceiver.java