public JpegMarker getNextMarker(bool allowskip)
        {
            if (!allowskip)
            {
                byte idL = input.ReadByte();
                if (idL != 0xff)
                {
                    throw new Exception("getNextMarker: (Noskip) Expected marker not found. Propably corrupt file.");
                }

                JpegMarker markL = (JpegMarker)input.ReadByte();

                if (JpegMarker.M_FILL == markL || JpegMarker.M_STUFF == markL)
                {
                    throw new Exception("getNextMarker: (Noskip) Expected marker, but found stuffed 00 or ff.");
                }

                return(markL);
            }
            input.skipToMarker();
            byte id = input.ReadByte();
            //TODO change
            //_ASSERTE(0xff == id);
            JpegMarker mark = (JpegMarker)input.ReadByte();

            return(mark);
        }