Skip to content

Instantly share code, notes, and snippets.

@bvdeenen
Created June 22, 2017 09:07
Show Gist options
  • Save bvdeenen/d6c2008449683c6817c240e4e8ff9487 to your computer and use it in GitHub Desktop.
Save bvdeenen/d6c2008449683c6817c240e4e8ff9487 to your computer and use it in GitHub Desktop.
// the gist of my deserialize
private DatumReader<GenericRecord> reader;
reader = new SpecificDatumReader<>(writerSchema, readerSchema);
GenericRecord deserialize(byte[] msg) throws IOException, IllegalStateException
{
BinaryDecoder decoder = DecoderFactory.get().binaryDecoder(msg, null);
return reader.read(null, decoder);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment