public static Event convertToAvroEvent()

in app/common/src/main/java/com/googlecodesamples/cloud/jss/common/util/MessageUtil.java [160:166]


  public static Event convertToAvroEvent(PubsubMessage message) throws IOException {
    Schema schema = Event.getClassSchema();
    SpecificDatumReader<Event> reader = new SpecificDatumReader<>(schema);
    InputStream inputStream = new ByteArrayInputStream(message.getData().toByteArray());
    Decoder decoder = DecoderFactory.get().jsonDecoder(schema, inputStream);
    return reader.read(null, decoder);
  }