Visual Basic (Declaration) | |
---|---|
Public Class HexStream Inherits System.Security.Cryptography.CryptoStream |
C# | |
---|---|
public class HexStream : System.Security.Cryptography.CryptoStream |
Library/Library.Test/TestHexEncoding.cs
C# | Copy Code |
---|---|
using (Stream mem = new MemoryStream()) { using (Stream io = new HexStream(new NonClosingStream(mem), CryptoStreamMode.Write)) io.Write(HexEncoding.DecodeBytes(AllHex), 0, AllHex.Length / 2); Assert.AreEqual(AllHex.Length, mem.Position); mem.Position = 0; string test = new StreamReader(mem).ReadToEnd(); Assert.AreEqual(AllHex, test); } |
VB.NET | Copy Code |
---|---|
Using mem As Stream = New MemoryStream() Using io As Stream = New HexStream(New NonClosingStream(mem), CryptoStreamMode.Write) io.Write(HexEncoding.DecodeBytes(AllHex), 0, AllHex.Length / 2) End Using Assert.AreEqual(AllHex.Length, mem.Position) mem.Position = 0 Dim test As String = New StreamReader(mem).ReadToEnd() Assert.AreEqual(AllHex, test) End Using |
System.Object
System.MarshalByRefObject
System.IO.Stream
System.Security.Cryptography.CryptoStream
CSharpTest.Net.Formatting.HexStream
Target Platforms: Windows XP, Windows Server 2003, Windows Vista, Windows Server 2008, Windows 7
Reference
HexStream MembersCSharpTest.Net.Formatting Namespace