if(id==null) throw new DigitalObjectNotFoundException("id is null");
// Fix up any encoding issues:
id = PDURI.encodePlanetsUriStringAsUri(id).toASCIIString();
DigitalObjectRefBean digoRef = dh.get(id);
if(digoRef==null) throw new DigitalObjectNotFoundException("digital object "+id+" not found");
// set the metadata if it's contained within the digital object
DigitalObject object = digoRef.getDigitalObject();
for(Metadata md : object.getMetadata()) {
if(md.getName().equals(MIME_TYPE_METADATA_NAME))
response.setContentType(md.getContent());
}
is = digoRef.getContentAsStream();
// read from input stream and write to client
int bytesRead = 0;
byte[] buffer = new byte[BUFFER_SIZE];
while((bytesRead=is.read(buffer))!=-1){