Share via


Base64Decoder.Convert method (Byte[], Int32, Int32, Byte[], Int32, Int32, Boolean, Int32, Int32, Boolean)

The Convert method decodes base64-encoded data.

Namespace:  Microsoft.Exchange.Data.Mime.Encoders
Assembly:  Microsoft.Exchange.Data.Common (in Microsoft.Exchange.Data.Common.dll)

Syntax

'Declaration
Public Overrides NotOverridable Sub Convert ( _
    input As Byte(), _
    inputIndex As Integer, _
    inputSize As Integer, _
    output As Byte(), _
    outputIndex As Integer, _
    outputSize As Integer, _
    flush As Boolean, _
    <OutAttribute> ByRef inputUsed As Integer, _
    <OutAttribute> ByRef outputUsed As Integer, _
    <OutAttribute> ByRef completed As Boolean _
)
'Usage
Dim instance As Base64Decoder
Dim input As Byte()
Dim inputIndex As Integer
Dim inputSize As Integer
Dim output As Byte()
Dim outputIndex As Integer
Dim outputSize As Integer
Dim flush As Boolean
Dim inputUsed As Integer
Dim outputUsed As Integer
Dim completed As Boolean

instance.Convert(input, inputIndex, inputSize, _
    output, outputIndex, outputSize, _
    flush, inputUsed, outputUsed, completed)
public override sealed void Convert(
    byte[] input,
    int inputIndex,
    int inputSize,
    byte[] output,
    int outputIndex,
    int outputSize,
    bool flush,
    out int inputUsed,
    out int outputUsed,
    out bool completed
)

Parameters

  • input
    Type: []

    A byte array that contains the base64-encoded data to convert to binary.

  • inputIndex
    Type: System.Int32

    The zero-based byte offset in input at which to begin reading the data to convert.

  • inputSize
    Type: System.Int32

    The maximum number of bytes to be read from input.

  • output
    Type: []

    A byte array that will contain the binary-encoded data.

  • outputIndex
    Type: System.Int32

    The zero-based byte offset in output at which to begin writing the data to convert.

  • outputSize
    Type: System.Int32

    The number of bytes to use in output.

  • flush
    Type: System.Boolean

    Set flush to true if this is the last block of data to be converted. Otherwise, set flush to false.

  • inputUsed
    Type: System.Int32

    The number of bytes that are actually read from input.

  • outputUsed
    Type: System.Int32

    The number of bytes that are actually written to output.

  • completed
    Type: System.Boolean

    A Boolean value that indicates that all data has been successfully encoded. The completed parameter is set to true when either all the input is consumed but the data is not flushed, or the rest of the input was flushed.

Exceptions

Exception Condition
ArgumentOutOfRangeException

This exception is thrown if any one of the following is true:

  • Either inputSize or outputSize is less than zero.

  • inputSize is greater than the length of input.

  • outputSize is greater than the length of output.

  • The sum of inputSize and inputIndex is greater than the size of input.

  • The sum of outputSize and outputIndex is greater than the size of output.

ArgumentNullException

This exception is thrown if either input is a null reference (Nothing in Visual Basic) (Nothing in Visual Basic) and inputSize is nonzero or output is a null reference (Nothing in Visual Basic) (Nothing in Visual Basic).

ByteEncoderException

This exception is thrown if input contains invalid base64-encoded data.

See also

Reference

Base64Decoder class

Base64Decoder members

Convert overload

Microsoft.Exchange.Data.Mime.Encoders namespace