MessageBuffer.BufferSize 属性

定义

获取此 MessageBuffer 使用的近似字节数。Gets the approximate number of bytes consumed by this MessageBuffer.

public:
 abstract property int BufferSize { int get(); };
public abstract int BufferSize { get; }
member this.BufferSize : int
Public MustOverride ReadOnly Property BufferSize As Integer

属性值

Int32

MessageBuffer 使用的近似字节数。The approximate number of bytes consumed by this MessageBuffer.

注解

可以通过将 BufferSize 设置为所需的最大字节数来控制缓冲区的最大大小。You can control the maximum size of the buffer by setting BufferSize to the maximum number of bytes desired. 这个最大数无需包含任何与生成缓冲区相关的瞬态分配或附加到消息的属性。This number does not necessarily cover any transient allocations related to building the buffer, or properties attached to the message. 进行序列化时,它与消息的实际大小无关。It is not related to the actual size of the message when serialized.

适用于