public abstract class AbstractDatabaseBlobService<T extends AbstractImage> extends AbstractSimpleBlobService {
private ImageDAO<T> imageDAO;
protected byte[] loadBytesInternal(String key, long startIndex, long endIndex) {
Long id = Long.parseLong(key);
AbstractImage image = imageDAO.find(id);
if (image != null) {
long min = (endIndex == Long.MAX_VALUE) ? image.getLength() : endIndex;
try {
return image.read(startIndex, min);
} catch (Exception e) {
throw new RuntimeException(e);
}
}
return null;