code: public static void write(DataOutput out,
                             String username, 
                             String groupname,
                             FsPermission permission) throws IOException {
      Text.writeStringOpt(out, username);
      Text.writeStringOpt(out, groupname);
      permission.write(out);
    }
docs: Serialize a {@link PermissionStatus} from its base components.