public override IAsyncResult BeginRead(byte[] buffer, int offset, int count, AsyncCallback callback, Object state) { if (m_Position >= m_Offset+m_Size) { count = 0; } else if (m_Position + count > m_Offset+m_Size) { count = (int)(m_Offset + m_Size - m_Position); } return m_ParentStream.BeginRead(buffer, offset, count, callback, state); }