예제 #1
0
        public void Seek(long postion, BssomSeekOrgin orgin, long limit)
        {
            if (orgin == BssomSeekOrgin.Current)
            {
                Position += postion;
            }
            else
            {
                Position = postion;
            }

            if (limit != -1 && Position > limit)
            {
                BssomSerializationOperationException.ReaderEndOfBufferException();
            }

            if (Spans.Length == 1)
            {
                CurrentSpanPosition = (int)Position;
            }
            else
            {
                CurrentSpanIndex = Array.BinarySearch(SpansCumulativeBoundary, Position);
                if (CurrentSpanIndex <= -1)
                {
                    CurrentSpanIndex = ~CurrentSpanIndex - 1;
                }

                CurrentSpanPosition = (int)(Position - SpansCumulativeBoundary[CurrentSpanIndex]);
            }
        }
예제 #2
0
 public void Seek(long postion, BssomSeekOrgin orgin = BssomSeekOrgin.Begin)
 {
     SeekWithOutVerify(postion, orgin);
     if (position > Length)
     {
         BssomSerializationOperationException.ReaderEndOfBufferException();
     }
 }
예제 #3
0
 public void Seek(long postion, BssomSeekOrgin orgin)
 {
     SeekWithOutVerify(postion, orgin);
     if (_offset > _buffer.Length)
     {
         BssomSerializationOperationException.ReaderEndOfBufferException();
     }
 }