public static TPipeTransferReq fromTPipeTransferReq(final TPipeTransferReq transferReq)
      throws IOException {
    final ByteBuffer compressedBuffer = transferReq.body;

    final List<PipeCompressor> compressors = new ArrayList<>();
    final List<Integer> uncompressedLengths = new ArrayList<>();
    final int compressorsSize = ReadWriteIOUtils.readByte(compressedBuffer);
    for (int i = 0; i < compressorsSize; ++i) {
      compressors.add(
          PipeCompressorFactory.getCompressor(ReadWriteIOUtils.readByte(compressedBuffer)));
      uncompressedLengths.add(ReadWriteIOUtils.readInt(compressedBuffer));
    }

    byte[] body = new byte[compressedBuffer.remaining()];
    compressedBuffer.get(body);

    for (int i = compressors.size() - 1; i >= 0; --i) {
      body = compressors.get(i).decompress(body, uncompressedLengths.get(i));
    }

    final ByteBuffer decompressedBuffer = ByteBuffer.wrap(body);

    final TPipeTransferReq decompressedReq = new TPipeTransferReq();
    decompressedReq.version = ReadWriteIOUtils.readByte(decompressedBuffer);
    decompressedReq.type = ReadWriteIOUtils.readShort(decompressedBuffer);
    decompressedReq.body = decompressedBuffer.slice();

    return decompressedReq;
  }
Get the original req from a compressed req.
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/pipe/connector/payload/thrift/request/PipeTransferCompressedReq.java