TProtocolReader reader = new TProtocolReader(protocol);
reader.readStructBegin();
Map.Entry<Short, Object> data = null;
Short fieldId = null;
while (reader.nextField()) {
checkState(fieldId == null, "Received Union with more than one value (seen id %s, now id %s)", fieldId, reader.getFieldId());
fieldId = reader.getFieldId();
// do we have a codec for this field