Decoder.GetCharCount calculates the number of characters produced by decoding a sequence of bytes : Decoder « Development « VB.Net






Decoder.GetCharCount calculates the number of characters produced by decoding a sequence of bytes

 

Imports System
Imports System.Text

Class DecoderExample

    Public Shared Sub Main()
        Dim bytes() As Byte = {86, 0, 111, 0, 1, 0, 11, 0, 111, 0, 222, 0, 101, 0}

        Dim uniDecoder As Decoder = Encoding.Unicode.GetDecoder()
        Dim charCount As Integer = uniDecoder.GetCharCount(bytes, 0, bytes.Length)
        Console.WriteLine("{0} characters needed to decode bytes.", charCount)
    End Sub
End Class

   
  








Related examples in the same category

1.Decoder Class converts a sequence of encoded bytes into a set of characters.
2.Create Decoder class.
3.Decodes a sequence of bytes from the specified byte array