public byte[] getBinaryResource(String uri) {
String ruri = _uriResolver.resolve(uri);
StreamResource sr = new StreamResource(ruri);
try {
sr.connect();
BufferedInputStream bis = sr.bufferedStream();
ByteArrayOutputStream result = new ByteArrayOutputStream(sr.hasStreamLength() ? sr.streamLength() : 4 * 1024);
byte[] buf = new byte[10240];
int i;
while ((i = bis.read(buf)) != -1) {