MetadataBuilder.ReserveUserString(Int32) 方法

定义

在用户字符串堆上为指定长度的字符串保留空间。Reserves space on the user string heap for a string of the specified length.

public:
 System::Reflection::Metadata::ReservedBlob<System::Reflection::Metadata::UserStringHandle> ReserveUserString(int length);
public System.Reflection.Metadata.ReservedBlob<System.Reflection.Metadata.UserStringHandle> ReserveUserString (int length);
member this.ReserveUserString : int -> System.Reflection.Metadata.ReservedBlob<System.Reflection.Metadata.UserStringHandle>
Public Function ReserveUserString (length As Integer) As ReservedBlob(Of UserStringHandle)

参数

length
Int32

要保留的字符数。The number of characters to reserve.

返回

ReservedBlob<UserStringHandle>

保留的用户字符串和表示整个用户字符串 blob (包括其长度和终端字符)的 Blob 的句柄。A handle to the reserved user string and a Blob representing the entire User String blob (including its length and terminal character). 该句柄可用于 LoadString(UserStringHandle)The handle may be used in LoadString(UserStringHandle). 使用 WriteUserString(String) 填充 blob 内容。Use WriteUserString(String) to fill in the blob content.

例外

堆上的剩余空间太小,无法容纳该字符串。The remaining space on the heap is too small to fit the string.

length 为负数。length is negative.

适用于