@Override
  public void write(Keyset keyset) throws IOException {
    try {
      outputStream.write(toJson(keyset).toString().getBytes(UTF_8));
      outputStream.write(System.lineSeparator().getBytes(UTF_8));
    } catch (JsonParseException e) {
      throw new IOException(e);
    } finally {
      outputStream.close();
    }
  }
Static method to create a JsonKeysetWriter that writes to a file path.

<p>This method only works on Android API level 26 or newer.

@deprecated Method should be inlined.
java_src/src/main/java/com/google/crypto/tink/JsonKeysetWriter.java