public static DatabasePrivilege readRelationalPrivilege(
      DataInputStream inputStream, String encoding, ThreadLocal<byte[]> strBufferLocal)
      throws IOException {
    String databaseName = IOUtils.readString(inputStream, encoding, strBufferLocal);
    DatabasePrivilege databasePrivilege = new DatabasePrivilege(databaseName);
    databasePrivilege.setPrivileges(inputStream.readInt());
    int tableNum = inputStream.readInt();
    for (int i = 0; i < tableNum; i++) {
      String tableName = IOUtils.readString(inputStream, encoding, strBufferLocal);
      TablePrivilege tablePrivilege = new TablePrivilege(tableName);
      tablePrivilege.setPrivileges(inputStream.readInt());
      databasePrivilege.getTablePrivilegeMap().put(tableName, tablePrivilege);
    }
    return databasePrivilege;
  }
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