public static void writePathPrivilege(
      OutputStream outputStream,
      PathPrivilege pathPrivilege,
      String encoding,
      ThreadLocal<ByteBuffer> encodingBufferLocal)
      throws IOException {
    writeString(outputStream, pathPrivilege.getPath().getFullPath(), encoding, encodingBufferLocal);
    writeInt(outputStream, pathPrivilege.getAllPrivileges(), encodingBufferLocal);
  }
Write a PathPrivilege to the given stream.

@param outputStream the destination to insert.
@param pathPrivilege the PathPrivilege to be written.
@param encoding string encoding like 'utf-8'.
@param encodingBufferLocal a ThreadLocal buffer may be passed to avoid frequently memory
    allocations. A null may also be passed to use a local buffer.
@throws IOException when an exception raised during operating the stream.
iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/IOUtils.java