public void Paste(IntPtr sourceStream, int copyPosition, int pastePosition, int length) { int pastedLength = 0; int result = Avi.EditStreamPaste(editableStream, ref pastePosition, ref pastedLength, sourceStream, copyPosition, length); if (result != 0) { throw new Exception("Exception in Paste: " + result.ToString()); } countFrames += pastedLength; }