* the document header starts.
     */
    private int skipPastAnyPrefixJunk(SeekableInput in) {
        if (!in.markSupported())
            return 0 ;
        try {
            final int scanLength = 2048;
            final String scanFor = "%PDF-1.";
            int scanForIndex = 0;
            in.mark(scanLength);
            for (int i = 0; i < scanLength; i++) {
                int data = in.read();
                if (data < 0) {
                    in.reset();
                    return 0;
                }
                if (data == scanFor.charAt(scanForIndex)) {
                    return i;
                } else {
                    scanForIndex = 0;
                }
            }
            // Searched through scanLength number of bytes and didn't find it,
            //  so reset, in case it was never there to find
            in.reset();
        }
        catch (IOException e) {
            try {
                in.reset();
            }
            catch (IOException e2) {
            }
        }
        return 0;
    }