To avoid the measure to be kept in memory, add the following before executing the method saveMeasure() :
measure.setPersistenceMode(PersistenceMode.DATABASE);
The current version of the API does not allow to inject/load binary measures. Like you suggested, the workaround is :
- encode data in base64
- develop a web service which directly returns data, with correct HTTP headers (mime type). Use the new extension point RubyRailsWebservice of API 1.11. Some examples are available in the plugins radiator and motionchart.
But the best solution is to improve the API (see issue
SONAR-1174), at least the missing method setData(byte[] data, String mime). Unfortunatly I can't give any release planning.
Simon