Export (0) Print
Expand All

Encoder.Convert Method (Char*, Int32, Byte*, Int32, Boolean, Int32%, Int32%, Boolean%)

This member can be used only by trusted applications. If you try to use this member in a partial-trust application, your code will throw a MethodAccessException exception. This member is security-critical, which restricts its use.
[SECURITY CRITICAL]

Converts a buffer of Unicode characters to an encoded byte sequence and stores the result in another buffer.

This API is not CLS-compliant. The CLS-compliant alternative is Convert(Char[], Int32, Int32, Byte[], Int32, Int32, Boolean, Int32, Int32, Boolean).

Namespace:  System.Text
Assembly:  mscorlib (in mscorlib.dll)

[CLSCompliantAttribute(false)]
[SecurityCriticalAttribute]
[ComVisibleAttribute(false)]
public virtual void Convert(
	char* chars,
	int charCount,
	byte* bytes,
	int byteCount,
	bool flush,
	out int charsUsed,
	out int bytesUsed,
	out bool completed
)

Parameters

chars
Type: System.Char*
The address of a string of UTF-16 encoded characters to convert.
charCount
Type: System.Int32
The number of characters in chars to convert.
bytes
Type: System.Byte*
The address of a buffer to store the converted bytes.
byteCount
Type: System.Int32
The maximum number of bytes in bytes to use in the conversion.
flush
Type: System.Boolean
true to indicate no further data is to be converted; otherwise, false.
charsUsed
Type: System.Int32%
When this method returns, contains the number of characters from chars that were used in the conversion. This parameter is passed uninitialized.
bytesUsed
Type: System.Int32%
When this method returns, contains the number of bytes that were used in the conversion. This parameter is passed uninitialized.
completed
Type: System.Boolean%
When this method returns, contains true if all the characters specified by charCount were converted; otherwise, false. This parameter is passed uninitialized.

Silverlight

Supported in: 4, 3

Silverlight for Windows Phone

Supported in: Windows Phone OS 7.1, Windows Phone OS 7.0

XNA Framework

Supported in: Xbox 360, Windows Phone OS 7.0

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft