*/
public void toStream(final OutputStream stream) throws CRException {
if (this.resolvableColl.isEmpty()) {
//No Data Found
throw new CRException("NoDataFound", "Data could not be found.", ERRORTYPE.NO_DATA_FOUND);
} else {
this.cr.put("status", "ok");
for (Iterator<CRResolvableBean> it = this.resolvableColl.iterator(); it.hasNext();) {
CRResolvableBean crBean = it.next();
Map<String, Object> objElement = processElement(crBean);
this.cr.put(crBean.getContentid(), objElement);
}
}
try {
OutputStreamWriter wr = new OutputStreamWriter(stream, this.getResponseEncoding());
wr.write(this.PHPSerializer.serialize(this.cr));
wr.flush();
wr.close();
} catch (IOException e) {
throw new CRException(e);
}
}