public synchronized void init() {
        if (inited) {
            return;
        }
        inited = true;
        InputStream in = null;
        try {
            stream.init();
            in = stream.getInputStreamForDecodedStreamBytes();
            if (logger.isLoggable(Level.FINEST)) {
                String content;
                if (in instanceof SeekableInput) {
                    content = Utils.getContentFromSeekableInput((SeekableInput) in, false);
                } else {
                    InputStream[] inArray = new InputStream[]{in};
                    content = Utils.getContentAndReplaceInputStream(inArray, false);
                    in = inArray[0];
                }
                logger.finest("Content = " + content);
            }
            if (in != null) {
                ICC_Profile profile = ICC_Profile.getInstance(in);
                colorSpace = new ICC_ColorSpace(profile);
            }
        } catch (Exception e) {
            logger.log(Level.FINE, "Error Processing ICCBased Colour Profile", e);
        }
        finally {
            try {
                if (in != null) in.close();
            }
            catch (IOException e) {
            }
        }
    }