Condividi tramite


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

Microsoft Silverlight will reach end of support after October 2021. Learn more.

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 encoded bytes to UTF-16 encoded characters and stores the result in another buffer.

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

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

Syntax

'Declaration
<CLSCompliantAttribute(False)> _
<ComVisibleAttribute(False)> _
<SecurityCriticalAttribute> _
Public Overridable Sub Convert ( _
    bytes As Byte*, _
    byteCount As Integer, _
    chars As Char*, _
    charCount As Integer, _
    flush As Boolean, _
    <OutAttribute> ByRef bytesUsed As Integer, _
    <OutAttribute> ByRef charsUsed As Integer, _
    <OutAttribute> ByRef completed As Boolean _
)
[CLSCompliantAttribute(false)]
[ComVisibleAttribute(false)]
[SecurityCriticalAttribute]
public virtual void Convert(
    byte* bytes,
    int byteCount,
    char* chars,
    int charCount,
    bool flush,
    out int bytesUsed,
    out int charsUsed,
    out bool completed
)

Parameters

  • bytes
    Type: System.Byte*
    The address of a buffer that contains the byte sequences to convert.
  • byteCount
    Type: System.Int32
    The number of bytes in bytes to convert.
  • chars
    Type: System.Char*
    The address of a buffer to store the converted characters.
  • charCount
    Type: System.Int32
    The maximum number of characters in chars to use in the conversion.
  • flush
    Type: System.Boolean
    true to indicate no further data is to be converted; otherwise, false.
  • bytesUsed
    Type: System.Int32%
    When this method returns, contains the number of bytes that were produced by the conversion. This parameter is passed uninitialized.
  • 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.
  • completed
    Type: System.Boolean%
    When this method returns, contains true if all the characters specified by byteCount were converted; otherwise, false. This parameter is passed uninitialized.

Version Information

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

Platforms

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