Code example for RuntimeException

0
            return MIME_TYPE_JPEG;
        } 
        else if (extension.equals("mpo")) {
            return MIME_TYPE_MPO;
        } 
        throw new RuntimeException("Unsupported image extension type: " + extension);
    } 
 
    public static Uri addImage(ContentResolver resolver, String title, String extension, long date,
                Location location, int orientation, byte[] jpeg, int width, int height) {
        // Save the image. 
        String path = generateFilepath(title, extension);
        FileOutputStream out = null;
        try { 
            out = new FileOutputStream(path);
            out.write(jpeg);
        } catch (Exception e) {
            Log.e(TAG, "Failed to write image", e);
            return null; 
        } finally { 
            try {