AMFMapper mapper = AMFMapperIntrospector.getAMFMapper(realType, genericType);
SerializationContext context = new SerializationContext();
Amf3Input input = new Amf3Input(context);
input.setInputStream(stream);
try {
return mapper.toJAXB(input.readObject(), new AMFMappingContext());
}
catch (ClassNotFoundException e) {
throw new IOException("Invalid request: " + e.getMessage());
}
}