Пример #1
0
        /// <summary>
        /// Returns the first base non-WrapperStream.
        /// </summary>
        /// <param name="stream">Potential WrapperStream</param>
        /// <returns>Base non-WrapperStream.</returns>
        public static Stream GetNonWrapperBaseStream(Stream stream)
        {
            WrapperStream wrapperStream = stream as WrapperStream;

            if (wrapperStream == null)
            {
                return(stream);
            }
            return(wrapperStream.GetNonWrapperBaseStream());
        }
Пример #2
0
        public static Stream SearchWrappedStream(Stream stream, OssFunc <Stream, bool> condition)
        {
            WrapperStream wrapperStream = stream as WrapperStream;

            if (wrapperStream == null)
            {
                return(condition(stream) ? stream : null);
            }
            return(wrapperStream.SearchWrappedStream(condition));
        }