Skip to content

Instantly share code, notes, and snippets.

@galderz
Created June 27, 2018 11:37
Show Gist options
  • Save galderz/debff7f6d84a942183dc4b879dbf28c1 to your computer and use it in GitHub Desktop.
Save galderz/debff7f6d84a942183dc4b879dbf28c1 to your computer and use it in GitHub Desktop.
SerializationContext serialCtx = ...
String protoFile = read(CryptoCurrency.class.getResourceAsStream("/crypto.proto"));
metadataCache.put("crypto.proto", protoFile);
...
serialCtx.registerProtoFiles(FileDescriptorSource.fromResources("/crypto.proto"));
serialCtx.registerMarshaller(new CryptoCurrencyMarshaller());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment