not sure about 2.0, however in 2.2 you could use something like this:
@Get
public Representation getImage() {
...
byte[] data = ...
ObjectRepresentation<byte[]> or=new ObjectRepresentation<byte[]>(data, MediaType.IMAGE_PNG) {
@Override
public void write(OutputStream os) throws IOException {
super.write(os);
os.write(this.getObject());
}
};
return or;
}