A wrapped stream that records what bytes are read, so it can report on what bytes are not read.
Inheritance: Stream
Exemple #1
0
        /// <summary>Switch to the use of a <see cref="MarkingStream"/>.</summary>
        /// <param name="reader"></param>
        /// <returns></returns>
        public MarkingStream StartMarking(out BinaryReader reader)
        {
            MarkingStream stream = StartMarking();

            reader = Reader;
            return(stream);
        }
Exemple #2
0
        /// <summary>Switch to the use of a <see cref="MarkingStream"/>.</summary>
        /// <returns></returns>
        public MarkingStream StartMarking()
        {
            if (Reader.BaseStream is MarkingStream)
            {
                return((MarkingStream)Reader.BaseStream);
            }

            var markingStream = new MarkingStream(Reader.BaseStream);

            if (Reader is BigEndianBinaryReader)
            {
                Reader = new BigEndianBinaryReader(markingStream);
            }
            else
            {
                Reader = new BinaryReader(markingStream);
            }

            return(markingStream);
        }
		/// <summary>Switch to the use of a <see cref="MarkingStream"/>.</summary>
		/// <returns></returns>
		public MarkingStream StartMarking() {
			if (Reader.BaseStream is MarkingStream) {
				return (MarkingStream)Reader.BaseStream;
			}

			var markingStream = new MarkingStream(Reader.BaseStream);
			if (Reader is BigEndianBinaryReader)
				Reader = new BigEndianBinaryReader(markingStream);
			else
				Reader = new BinaryReader(markingStream);

			return markingStream;
		}