CSharpTest.Net
Safe64Stream.Transform Constructor
See Also  Example Send Feedback Download Help File
CSharpTest.Net.Library Assembly > CSharpTest.Net.Formatting Namespace > Safe64Stream.Transform Class : Safe64Stream.Transform Constructor

mode

Glossary Item Box

Provides a crypto-transform used to read/write to a stream of base-64 characters while replacing '+' with '-' and '/' with '_' and ommitting padding.

Syntax

Visual Basic (Declaration) 
Public Function New( _
   ByVal mode As CryptoStreamMode _
)
C# 
public Safe64Stream.Transform( 
   CryptoStreamMode mode
)

Parameters

mode

Example

Library/Library.Test/TestSafe64Encoding.cs

C#Copy Code
using (ICryptoTransform xform = new Safe64Stream.Transform(CryptoStreamMode.Read))
{
    Assert.AreEqual(4, xform.InputBlockSize);
    Assert.AreEqual(3, xform.OutputBlockSize);
    Assert.AreEqual(true, xform.CanReuseTransform);
    Assert.AreEqual(true, xform.CanTransformMultipleBlocks);
}
using (ICryptoTransform xform = new Safe64Stream.Transform(CryptoStreamMode.Write))
{
    Assert.AreEqual(3, xform.InputBlockSize);
    Assert.AreEqual(4, xform.OutputBlockSize);
    Assert.AreEqual(true, xform.CanReuseTransform);
    Assert.AreEqual(true, xform.CanTransformMultipleBlocks);
}
VB.NETCopy Code
Using xform As ICryptoTransform = New Safe64Stream.Transform(CryptoStreamMode.Read)
    Assert.AreEqual(4, xform.InputBlockSize)
    Assert.AreEqual(3, xform.OutputBlockSize)
    Assert.AreEqual(True, xform.CanReuseTransform)
    Assert.AreEqual(True, xform.CanTransformMultipleBlocks)
End Using
Using xform As ICryptoTransform = New Safe64Stream.Transform(CryptoStreamMode.Write)
    Assert.AreEqual(3, xform.InputBlockSize)
    Assert.AreEqual(4, xform.OutputBlockSize)
    Assert.AreEqual(True, xform.CanReuseTransform)
    Assert.AreEqual(True, xform.CanTransformMultipleBlocks)
End Using

Requirements

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

See Also

Generated with Document! X 2011 by Innovasys