Export (0) Print
Expand All

Encoder.GetBytes Method (Char*, Int32, Byte*, 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]

When overridden in a derived class, encodes a set of characters starting at the specified character pointer and any characters in the internal buffer into a sequence of bytes that are stored starting at the specified byte pointer. A parameter indicates whether to clear the internal state of the encoder after the conversion.

This API is not CLS-compliant. 

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

[CLSCompliantAttribute(false)]
[ComVisibleAttribute(false)]
[SecurityCriticalAttribute]
public virtual int GetBytes(
	char* chars,
	int charCount,
	byte* bytes,
	int byteCount,
	bool flush
)

Parameters

chars
Type: System.Char*
A pointer to the first character to encode.
charCount
Type: System.Int32
The number of characters to encode.
bytes
Type: System.Byte*
A pointer to the location at which to start writing the resulting sequence of bytes.
byteCount
Type: System.Int32
The maximum number of bytes to write.
flush
Type: System.Boolean
true to clear the internal state of the encoder after the conversion; otherwise, false.

Return Value

Type: System.Int32
The actual number of bytes written at the location indicated by the bytes parameter.

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