示例#1
0
        //private long _lastEndOfFileOffset = -1;
        public long Seek(long offset, SeekOrigin origin, bool leaveInUse = false)
        {
            //#if (_Linux)
            //            // linux doesn't expand the file if seek-ed beyond eof...
            //            if (RealStream.Length < offset)
            //                RealStream.SetLength(offset);
            //#endif
            InUse = true;
            long l = RealStream.Seek(offset, origin);

            //if (origin == SeekOrigin.End && offset >= 0)
            //{
            //    if (l < _lastEndOfFileOffset + offset)
            //    {
            //        l = _lastEndOfFileOffset + offset;
            //        RealStream.Seek(l, SeekOrigin.Begin);
            //    }
            //    _lastEndOfFileOffset = l;
            //}
            if (!leaveInUse)
            {
                InUse = leaveInUse;
            }
            return(l);
        }
示例#2
0
        public long Seek(long offset, SeekOrigin origin)
        {
            long l = RealStream.Seek(offset, origin);

            InUse = false;
            return(l);
        }