class JavaImageIOIdentify implements Identify {

    public IdentifyResult identify(DigitalObject dob, List<Parameter> parameters ) {
        // Start timing...
        ServicePerformanceHelper sph = new ServicePerformanceHelper();
        
        // Initialise the result:
        ImageReader imageReader = null;

        // Can only cope if the object is 'simple':
        if (dob.getContent() == null) {
            return returnWithErrorMessage(ServiceUtils
                    .createErrorReport("The Content of the DigitalObject should not be NULL."));
        }
        // If this is an embedded binary:
        try {
            imageReader = getFormatName(dob.getContent().getInputStream());
            // Record time take to load the input into memory:
            sph.loaded();

            if (imageReader == null || imageReader.getFormatName() == null)
                return returnWithErrorMessage(ServiceUtils.createErrorReport("Could not identify the image."));
            
            List<URI> types = new ArrayList<URI>();
            URI typeURI = FormatRegistryFactory.getFormatRegistry().createExtensionUri(sanitize(imageReader.getFormatName()));
            types.add(typeURI);
            log.fine(String.format("Identified %s as %s", dob, types));
            
            ServiceReport rep = new ServiceReport(Type.INFO, Status.SUCCESS, "OK", sph.getPerformanceProperties() );
            return new IdentifyResult(types,
                    IdentifyResult.Method.PARTIAL_PARSE, rep);
        } catch (IOException e) {
            return returnWithErrorMessage(ServiceUtils.createErrorReport("IOException reading the image: " + e));
        }

    }

}