@Override
  public void write(EncryptedKeyset keyset) throws IOException {
    boolean success = editor.putString(keysetName, Hex.encode(keyset.toByteArray())).commit();
    if (!success) {
      throw new IOException("Failed to write to SharedPreferences");
    }
  }
Creates a {@link KeysetReader} that hex-encodes and writes keysets to the preference
name {@code keysetName} in the private shared preferences file {@code prefFileName}.

<p>If {@code prefFileName} is null, uses the default shared preferences file.

@throws IOException if cannot write the keyset
@throws IllegalArgumentException if {@code keysetName} is null
java_src/src/main/java/com/google/crypto/tink/integration/android/SharedPrefKeysetWriter.java