private int Read(byte[] buffer, int offset, int count) { System.Diagnostics.Debug.Assert(buffer != null); System.Diagnostics.Debug.Assert(0 <= offset && offset < buffer.Length); System.Diagnostics.Debug.Assert(0 < count && count <= buffer.Length - offset); EnsureOutputData(); var fetched = mDecoder.ReadOutputData(buffer, offset, count); System.Diagnostics.Debug.Assert(0 <= fetched && fetched <= count); mPosition += fetched; return(fetched); }