}
public void paint(OutputStream stream, Object object) throws IOException {
Object responseObject = FacesContext.getCurrentInstance().getExternalContext().getResponse();
if (responseObject instanceof RenderResponse) {
BufferedRenderResponseWrapper brrw = (BufferedRenderResponseWrapper)responseObject;
RenderResponse response = brrw.getResponse();
response.getPortletOutputStream().write(getFiles().get((Integer)object).getData());
}else{
//servlet response
stream.write(getFiles().get((Integer)object).getData());