private static HashType toProtoHashType(AesGcmHkdfStreamingParameters.HashType hashType)
      throws GeneralSecurityException {
    if (AesGcmHkdfStreamingParameters.HashType.SHA1.equals(hashType)) {
      return HashType.SHA1;
    }
    if (AesGcmHkdfStreamingParameters.HashType.SHA256.equals(hashType)) {
      return HashType.SHA256;
    }
    if (AesGcmHkdfStreamingParameters.HashType.SHA512.equals(hashType)) {
      return HashType.SHA512;
    }
    throw new GeneralSecurityException("Unable to serialize HashType " + hashType);
  }
Methods to serialize and parse {@link AesGcmHkdfStreamingKey} objects and {@link
AesGcmHkdfStreamingParameters} objects
java_src/src/main/java/com/google/crypto/tink/streamingaead/internal/AesGcmHkdfStreamingProtoSerialization.java