Пример #1
0
        public static FileStreamUnbufferedSequentialRead OpenReadStream(string path, long start)
        {
            if (SUPPORT_SHARED_STREAMS)
            {
                FileStreamUnbufferedSequentialRead stream = null;
                bool shared = c_sharedStreams.ContainsKey(path);

                if (shared)
                {
                    stream = c_sharedStreams[path];
                }

                if (stream == null)
                {
                    stream = new FileStreamUnbufferedSequentialRead(path, start);

                    if (shared)
                    {
                        c_sharedStreams[path] = stream;
                    }
                }

                return(stream);
            }
            else
            {
                return(new FileStreamUnbufferedSequentialRead(path, start));
            }
        }
Пример #2
0
        public static FileStreamUnbufferedSequentialRead OpenReadStream(string path, long start)
        {
            if (SUPPORT_SHARED_STREAMS)
            {
                FileStreamUnbufferedSequentialRead stream = null;
                bool shared = c_sharedStreams.ContainsKey(path);

                if (shared)
                    stream = c_sharedStreams[path];

                if (stream == null)
                {
                    stream = new FileStreamUnbufferedSequentialRead(path, start);

                    if (shared)
                        c_sharedStreams[path] = stream;
                }

                return stream;
            }
            else
            {
                return new FileStreamUnbufferedSequentialRead(path, start);
            }
        }