public static PipeSubscribeUnsubscribeResp toTPipeSubscribeResp(
      final TSStatus status, final Map<String, TopicConfig> topics) throws IOException {
    final PipeSubscribeUnsubscribeResp resp = toTPipeSubscribeResp(status);

    try (final PublicBAOS byteArrayOutputStream = new PublicBAOS();
        final DataOutputStream outputStream = new DataOutputStream(byteArrayOutputStream)) {
      ReadWriteIOUtils.write(topics.size(), outputStream);
      for (final Map.Entry<String, TopicConfig> entry : topics.entrySet()) {
        ReadWriteIOUtils.write(entry.getKey(), outputStream);
        entry.getValue().serialize(outputStream);
      }
      resp.body =
          Collections.singletonList(
              ByteBuffer.wrap(byteArrayOutputStream.getBuf(), 0, byteArrayOutputStream.size()));
    }

    return resp;
  }
Serialize the incoming parameters into `PipeSubscribeUnsubscribeResp`, called by the
subscription server.
iotdb-client/service-rpc/src/main/java/org/apache/iotdb/rpc/subscription/payload/response/PipeSubscribeUnsubscribeResp.java