コード例 #1
0
        private int FinishRead(int bytesRead)
        {
            MaxMessageSizeStream maxMessageSizeStream = this;

            maxMessageSizeStream.totalBytesRead = maxMessageSizeStream.totalBytesRead + (long)bytesRead;
            return(bytesRead);
        }
コード例 #2
0
        private void PrepareWrite(int bytesToWrite)
        {
            if (this.bytesWritten + (long)bytesToWrite > this.maxMessageSize)
            {
                throw Microsoft.ServiceBus.Diagnostics.DiagnosticUtility.ExceptionUtility.ThrowHelperError(MaxMessageSizeStream.CreateMaxSentMessageSizeExceededException(this.maxMessageSize));
            }
            MaxMessageSizeStream maxMessageSizeStream = this;

            maxMessageSizeStream.bytesWritten = maxMessageSizeStream.bytesWritten + (long)bytesToWrite;
        }
コード例 #3
0
 private int PrepareRead(int bytesToRead)
 {
     if (this.totalBytesRead >= this.maxMessageSize)
     {
         throw Microsoft.ServiceBus.Diagnostics.DiagnosticUtility.ExceptionUtility.ThrowHelperError(MaxMessageSizeStream.CreateMaxReceivedMessageSizeExceededException(this.maxMessageSize));
     }
     if (this.maxMessageSize - this.totalBytesRead > (long)2147483647)
     {
         return(bytesToRead);
     }
     return(Math.Min(bytesToRead, (int)(this.maxMessageSize - this.totalBytesRead)));
 }