public synchronized void init() {
        try {
            // make sure we are not revisiting this method
            if (isInited) {
                return;
            }
//try { throw new RuntimeException("Page.init() ****"); } catch(Exception e) { e.printStackTrace(); }

            // do a little clean up to keep the mem footprint small
            boolean lowMemory = MemoryManager.getInstance().isLowMemory();
            if (lowMemory && logger.isLoggable(Level.FINER)) {
                logger.finer("Low memory conditions encountered, clearing page cache");
            }

            // get pages resources
            initPageResources();

            // annotations
            initPageAnnotations();

            // Get the value of the page's content entry
            initPageContents();

            /**
             * Finally iterate through the contents vector and concat all of the
             * the resourse streams together so that the content parser can
             * go to town and build all of the page's shapes.
             */

            if (contents != null) {
                Vector<InputStream> inputStreamsVec = new Vector<InputStream>(contents.size());
                for (Stream stream : contents) {
                    //byte[] streamBytes = stream.getBytes();
                    //ByteArrayInputStream input = new ByteArrayInputStream(streamBytes);
                    InputStream input = stream.getInputStreamForDecodedStreamBytes();
                    inputStreamsVec.add(input);
/*
                    InputStream input = stream.getInputStreamForDecodedStreamBytes();
                    InputStream[] inArray = new InputStream[] { input };////
                    String content = Utils.getContentAndReplaceInputStream( inArray, false );
                    input = inArray[0];
                    System.out.println("Page.init()  Stream: " + stream);
                    System.out.println("Page.init()  Content: " + content);
*/
                }
                SequenceInputStream sis = new SequenceInputStream(inputStreamsVec.iterator());

                // push the library and resources to the content parse
                // and return the the shapes vector for the screen elements
                // for the page/resources in question.
                try {
                    ContentParser cp = new ContentParser(library, resources);
                    shapes = cp.parse(sis);
                } catch (Exception e) {
                    shapes = new Shapes();
                    logger.log(Level.FINE, "Error initializing Page.", e);
                } finally {
                    try {
                        sis.close();
                    } catch (IOException e) {
                        logger.log(Level.FINE, "Error closing page stream.", e);
                    }
                }
            }
            // empty page, nothing to do.
            else {
                shapes = new Shapes();
            }
            // set the initiated flag
            isInited = true;

        } catch (InterruptedException e) {
            // keeps shapes vector so we can paint what we have but make init state as false
            // so we can try to re parse it later.
            isInited = false;
            logger.log(Level.SEVERE, "Page initializing thread interrupted.", e);
        }

    }