CSharpTest.Net
DecodeBytes(String) Method
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Formatting Namespace > Safe64Encoding Class > DecodeBytes Method : DecodeBytes(String) Method

input

Glossary Item Box

Decodes the ascii text from the bytes provided into the original byte array

Syntax

Visual Basic (Declaration) 
Public Overloads Shared Function DecodeBytes( _
   ByVal input As String _
) As Byte()
C# 
public static byte[] DecodeBytes( 
   string input
)

Parameters

input

Example

Library/Library.Test/TestSafe64Encoding.cs

C#Copy Code
string encoded = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_";
byte[] data = Safe64Encoding.DecodeBytes(encoded);
byte[] test;
using (Stream io = new Safe64Stream(new MemoryStream(Encoding.ASCII.GetBytes(encoded)), CryptoStreamMode.Read))
    test = IOStream.Read(io, data.Length);

Assert.AreEqual(data, test);
VB.NETCopy Code
Dim encoded As String = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789-_"
Dim data As Byte() = Safe64Encoding.DecodeBytes(encoded)
Dim test As Byte()
Using io As Stream = New Safe64Stream(New MemoryStream(Encoding.ASCII.GetBytes(encoded)), CryptoStreamMode.Read)
    test = IOStream.Read(io, data.Length)
End Using

Assert.AreEqual(data, test)

Requirements

Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7

See Also

Generated with Document! X 2011 by Innovasys