Microsoft.Protocols.TestSuites.MS_OXCPRPT.MS_OXCPRPTAdapter.RopWriteAndCommitStreamMethod C# (CSharp) Method

RopWriteAndCommitStreamMethod() public method

This method is used to write bytes to a stream and commits the stream.
public RopWriteAndCommitStreamMethod ( CPRPTErrorCode &error ) : void
error CPRPTErrorCode This ROP MUST NOT be used on Stream objects opened on /// properties on Folder objects which means it should be failed against Folder object.
return void
        public void RopWriteAndCommitStreamMethod(out CPRPTErrorCode error)
        {
            error = CPRPTErrorCode.None;
            bool isWriteCorrectDataToStream = false;
            RopSeekStreamResponse seekStreamResponse1 = this.RopSeekStream(this.cprptCurrentHandle, (byte)Origin.Current, 0, true);
            RopWriteStreamResponse writeStreamResponse = this.RopWriteAndCommitStream(this.cprptCurrentHandle, WriteData, false);
            RopSeekStreamResponse seekStreamResponse2 = this.RopSeekStream(this.cprptCurrentHandle, (byte)Origin.Current, 0, true);

            if (seekStreamResponse2.NewPosition - seekStreamResponse1.NewPosition == (ulong)WriteData.Length)
            {
                isWriteCorrectDataToStream = true;
            }

            // Message and attachment object can only be changed after saving.
            this.RopSaveChangesAttachment(cprptAttachmentHandle[0], true);
            this.RopSaveChangesMessage(cprptMessageHandle[0], true);

            this.VerifyRopWriteAndCommitStream(writeStreamResponse, isWriteCorrectDataToStream);

            if (this.cprptCurrentType == ServerObjectType.Folder && writeStreamResponse.ReturnValue != (uint)CPRPTErrorCode.None)
            {
                error = CPRPTErrorCode.NotFound;
            }
        }
MS_OXCPRPTAdapter