Пример #1
0
        public MemoryStreamEx MoveStream(int index)
        {
            MemoryStreamEx oldStream = (MemoryStreamEx)m_streamList[m_nActivedStreamPosition];

            if (index > 0)
            {
                if (index < oldStream.Length)
                {
                    m_nActivedStreamPosition = (m_nActivedStreamPosition + 1) % m_nMaxStreamCount;
                    MemoryStreamEx newStream = (MemoryStreamEx)m_streamList[m_nActivedStreamPosition];
                    newStream.Clear();
                    newStream.Write(oldStream.GetBuffer(), (int)index, (int)(oldStream.Length - index));
                    oldStream.Clear();
                    return(newStream);
                }
                else
                {
                    oldStream.Clear();
                }
            }
            return(oldStream);
        }