FromBase64Transform クラス
base 64 から CryptoStream を変換します。
名前空間: System.Security.Cryptography
アセンブリ: mscorlib (mscorlib.dll 内)
構文
<ComVisibleAttribute(True)> _ Public Class FromBase64Transform Implements ICryptoTransform, IDisposable
[ComVisibleAttribute(true)] public class FromBase64Transform : ICryptoTransform, IDisposable
/** @attribute ComVisibleAttribute(true) */ public class FromBase64Transform implements ICryptoTransform, IDisposable
ComVisibleAttribute(true) public class FromBase64Transform implements ICryptoTransform, IDisposable


Imports System Imports System.IO Imports System.Security.Cryptography Namespace ToBase64Transform_Examples Class MyMainClass Public Shared Sub Main() 'Insert your file names into this method call. DecodeFromFile("c:\encoded.txt", "c:\roundtrip.txt") End Sub 'Main Public Shared Sub DecodeFromFile(ByVal inFileName As String, ByVal outFileName As String) Dim myTransform As New FromBase64Transform(FromBase64TransformMode.IgnoreWhiteSpaces) Dim myOutputBytes(myTransform.OutputBlockSize - 1) As Byte 'Open the input and output files. Dim myInputFile As New FileStream(inFileName, FileMode.Open, FileAccess.Read) Dim myOutputFile As New FileStream(outFileName, FileMode.Create, FileAccess.Write) 'Retrieve the file contents into a byte array. Dim myInputBytes(myInputFile.Length - 1) As Byte myInputFile.Read(myInputBytes, 0, myInputBytes.Length) 'Transform the data in chunks the size of InputBlockSize. Dim i As Integer = 0 While myInputBytes.Length - i > 4 'myTransform.InputBlockSize myTransform.TransformBlock(myInputBytes, i, 4, myOutputBytes, 0) 'myTransform.InputBlockSize i += 4 'myTransform.InputBlockSize myOutputFile.Write(myOutputBytes, 0, myTransform.OutputBlockSize) End While 'Transform the final block of data. myOutputBytes = myTransform.TransformFinalBlock(myInputBytes, i, myInputBytes.Length - i) myOutputFile.Write(myOutputBytes, 0, myOutputBytes.Length) 'Free up any used resources. myTransform.Clear() myInputFile.Close() myOutputFile.Close() End Sub 'DecodeFromFile End Class 'MyMainClass End Namespace 'ToBase64Transform_Examples
using System; using System.IO; using System.Security.Cryptography; namespace ToBase64Transform_Examples { class MyMainClass { public static void Main() { //Insert your file names into this method call. DecodeFromFile("c:\\encoded.txt", "c:\\roundtrip.txt"); } public static void DecodeFromFile(string inFileName, string outFileName) { FromBase64Transform myTransform = new FromBase64Transform(FromBase64TransformMode.IgnoreWhiteSpaces); byte[] myOutputBytes = new byte[myTransform.OutputBlockSize]; //Open the input and output files. FileStream myInputFile = new FileStream(inFileName, FileMode.Open, FileAccess.Read); FileStream myOutputFile = new FileStream(outFileName, FileMode.Create, FileAccess.Write); //Retrieve the file contents into a byte array. byte[] myInputBytes = new byte[myInputFile.Length]; myInputFile.Read(myInputBytes, 0, myInputBytes.Length); //Transform the data in chunks the size of InputBlockSize. int i = 0; while(myInputBytes.Length - i > 4/*myTransform.InputBlockSize*/) { myTransform.TransformBlock(myInputBytes, i, 4/*myTransform.InputBlockSize*/, myOutputBytes, 0); i += 4/*myTransform.InputBlockSize*/; myOutputFile.Write(myOutputBytes, 0, myTransform.OutputBlockSize); } //Transform the final block of data. myOutputBytes = myTransform.TransformFinalBlock(myInputBytes, i, myInputBytes.Length - i); myOutputFile.Write(myOutputBytes, 0, myOutputBytes.Length); //Free up any used resources. myTransform.Clear(); myInputFile.Close(); myOutputFile.Close(); } } }
using namespace System; using namespace System::IO; using namespace System::Security::Cryptography; class MyMainClass { public: static void DecodeFromFile( String^ inFileName, String^ outFileName ) { FromBase64Transform^ myTransform = gcnew FromBase64Transform( FromBase64TransformMode::IgnoreWhiteSpaces ); array<Byte>^myOutputBytes = gcnew array<Byte>(myTransform->OutputBlockSize); //Open the input and output files. FileStream^ myInputFile = gcnew FileStream( inFileName,FileMode::Open,FileAccess::Read ); FileStream^ myOutputFile = gcnew FileStream( outFileName,FileMode::Create,FileAccess::Write ); //Retrieve the file contents into a Byte array. array<Byte>^myInputBytes = gcnew array<Byte>(myInputFile->Length); myInputFile->Read( myInputBytes, 0, myInputBytes->Length ); //Transform the data in chunks the size of InputBlockSize. int i = 0; while ( myInputBytes->Length - i > 4 ) { myTransform->TransformBlock( myInputBytes, i, 4, myOutputBytes, 0 ); /*myTransform->InputBlockSize*/ i += 4; /*myTransform->InputBlockSize*/ myOutputFile->Write( myOutputBytes, 0, myTransform->OutputBlockSize ); } //Transform the final block of data. myOutputBytes = myTransform->TransformFinalBlock( myInputBytes, i, myInputBytes->Length - i ); myOutputFile->Write( myOutputBytes, 0, myOutputBytes->Length ); //Free up any used resources. myTransform->Clear(); myInputFile->Close(); myOutputFile->Close(); } }; int main() { MyMainClass * m = new MyMainClass; //Insert your file names into this method call. m->DecodeFromFile( "c:\\encoded.txt", "c:\\roundtrip.txt" ); }
package ToBase64Transform_Examples; import System.*; import System.IO.*; import System.Security.Cryptography.*; class MyMainClass { public static void main(String[] args) { // Insert your file names into this method call. DecodeFromFile("c:\\encoded.txt", "c:\\roundtrip.txt"); } //main public static void DecodeFromFile(String inFileName, String outFileName) { FromBase64Transform myTransform = new FromBase64Transform(FromBase64TransformMode.IgnoreWhiteSpaces); ubyte myOutputBytes[] = new ubyte[myTransform.get_OutputBlockSize()]; // Open the input and output files. FileStream myInputFile = new FileStream(inFileName, FileMode.Open, FileAccess.Read); FileStream myOutputFile = new FileStream(outFileName, FileMode.Create, FileAccess.Write); // Retrieve the file contents into a byte array. // const int temp = 2; ubyte myInputBytes[] = new ubyte[(new Long(myInputFile.get_Length())).intValue()]; myInputFile.Read(myInputBytes, 0, myInputBytes.length); // Transform the data in chunks the size of InputBlockSize. int i = 0; while (myInputBytes.length - i > 4/*myTransform.InputBlockSize*/) { myTransform.TransformBlock(myInputBytes, i, 4/*myTransform.InputBlockSize*/, myOutputBytes, 0); i += 4 /*myTransform.InputBlockSize*/; myOutputFile.Write(myOutputBytes, 0, myTransform.get_OutputBlockSize()); } // Transform the final block of data. myOutputBytes = myTransform.TransformFinalBlock(myInputBytes, i, myInputBytes.length - i); myOutputFile.Write(myOutputBytes, 0, myOutputBytes.length); // Free up any used resources. myTransform.Clear(); myInputFile.Close(); myOutputFile.Close(); } //DecodeFromFile } //MyMainClass

System.Security.Cryptography.FromBase64Transform


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


FromBase64Transform コンストラクタ ()
FromBase64Transform クラスの新しいインスタンスを初期化します。
名前空間: System.Security.Cryptography
アセンブリ: mscorlib (mscorlib.dll 内)
構文


Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


FromBase64Transform コンストラクタ
FromBase64Transform クラスの新しいインスタンスを初期化します。
オーバーロードの一覧
名前 | 説明 |
---|---|
FromBase64Transform () | FromBase64Transform クラスの新しいインスタンスを初期化します。 |
FromBase64Transform (FromBase64TransformMode) | 変換モードを指定して、FromBase64Transform クラスの新しいインスタンスを初期化します。 |

FromBase64Transform コンストラクタ (FromBase64TransformMode)
変換モードを指定して、FromBase64Transform クラスの新しいインスタンスを初期化します。
名前空間: System.Security.Cryptography
アセンブリ: mscorlib (mscorlib.dll 内)
構文
- whitespaces
FromBase64Transform 値の 1 つ。

Imports System Imports System.IO Imports System.Security.Cryptography Namespace ToBase64Transform_Examples Class MyMainClass Public Shared Sub Main() 'Insert your file names into this method call. DecodeFromFile("c:\encoded.txt", "c:\roundtrip.txt") End Sub 'Main Public Shared Sub DecodeFromFile(ByVal inFileName As String, ByVal outFileName As String) Dim myTransform As New FromBase64Transform(FromBase64TransformMode.IgnoreWhiteSpaces) Dim myOutputBytes(myTransform.OutputBlockSize - 1) As Byte 'Open the input and output files. Dim myInputFile As New FileStream(inFileName, FileMode.Open, FileAccess.Read) Dim myOutputFile As New FileStream(outFileName, FileMode.Create, FileAccess.Write) 'Retrieve the file contents into a byte array. Dim myInputBytes(myInputFile.Length - 1) As Byte myInputFile.Read(myInputBytes, 0, myInputBytes.Length) 'Transform the data in chunks the size of InputBlockSize. Dim i As Integer = 0 While myInputBytes.Length - i > 4 'myTransform.InputBlockSize myTransform.TransformBlock(myInputBytes, i, 4, myOutputBytes, 0) 'myTransform.InputBlockSize i += 4 'myTransform.InputBlockSize myOutputFile.Write(myOutputBytes, 0, myTransform.OutputBlockSize) End While 'Transform the final block of data. myOutputBytes = myTransform.TransformFinalBlock(myInputBytes, i, myInputBytes.Length - i) myOutputFile.Write(myOutputBytes, 0, myOutputBytes.Length) 'Free up any used resources. myTransform.Clear() myInputFile.Close() myOutputFile.Close() End Sub 'DecodeFromFile End Class 'MyMainClass End Namespace 'ToBase64Transform_Examples
using System; using System.IO; using System.Security.Cryptography; namespace ToBase64Transform_Examples { class MyMainClass { public static void Main() { //Insert your file names into this method call. DecodeFromFile("c:\\encoded.txt", "c:\\roundtrip.txt"); } public static void DecodeFromFile(string inFileName, string outFileName) { FromBase64Transform myTransform = new FromBase64Transform(FromBase64TransformMode.IgnoreWhiteSpaces); byte[] myOutputBytes = new byte[myTransform.OutputBlockSize]; //Open the input and output files. FileStream myInputFile = new FileStream(inFileName, FileMode.Open, FileAccess.Read); FileStream myOutputFile = new FileStream(outFileName, FileMode.Create, FileAccess.Write); //Retrieve the file contents into a byte array. byte[] myInputBytes = new byte[myInputFile.Length]; myInputFile.Read(myInputBytes, 0, myInputBytes.Length); //Transform the data in chunks the size of InputBlockSize. int i = 0; while(myInputBytes.Length - i > 4/*myTransform.InputBlockSize*/) { myTransform.TransformBlock(myInputBytes, i, 4/*myTransform.InputBlockSize*/, myOutputBytes, 0); i += 4/*myTransform.InputBlockSize*/; myOutputFile.Write(myOutputBytes, 0, myTransform.OutputBlockSize); } //Transform the final block of data. myOutputBytes = myTransform.TransformFinalBlock(myInputBytes, i, myInputBytes.Length - i); myOutputFile.Write(myOutputBytes, 0, myOutputBytes.Length); //Free up any used resources. myTransform.Clear(); myInputFile.Close(); myOutputFile.Close(); } } }
using namespace System; using namespace System::IO; using namespace System::Security::Cryptography; class MyMainClass { public: static void DecodeFromFile( String^ inFileName, String^ outFileName ) { FromBase64Transform^ myTransform = gcnew FromBase64Transform( FromBase64TransformMode::IgnoreWhiteSpaces ); array<Byte>^myOutputBytes = gcnew array<Byte>(myTransform->OutputBlockSize); //Open the input and output files. FileStream^ myInputFile = gcnew FileStream( inFileName,FileMode::Open,FileAccess::Read ); FileStream^ myOutputFile = gcnew FileStream( outFileName,FileMode::Create,FileAccess::Write ); //Retrieve the file contents into a Byte array. array<Byte>^myInputBytes = gcnew array<Byte>(myInputFile->Length); myInputFile->Read( myInputBytes, 0, myInputBytes->Length ); //Transform the data in chunks the size of InputBlockSize. int i = 0; while ( myInputBytes->Length - i > 4 ) { myTransform->TransformBlock( myInputBytes, i, 4, myOutputBytes, 0 ); /*myTransform->InputBlockSize*/ i += 4; /*myTransform->InputBlockSize*/ myOutputFile->Write( myOutputBytes, 0, myTransform->OutputBlockSize ); } //Transform the final block of data. myOutputBytes = myTransform->TransformFinalBlock( myInputBytes, i, myInputBytes->Length - i ); myOutputFile->Write( myOutputBytes, 0, myOutputBytes->Length ); //Free up any used resources. myTransform->Clear(); myInputFile->Close(); myOutputFile->Close(); } }; int main() { MyMainClass * m = new MyMainClass; //Insert your file names into this method call. m->DecodeFromFile( "c:\\encoded.txt", "c:\\roundtrip.txt" ); }
package ToBase64Transform_Examples; import System.*; import System.IO.*; import System.Security.Cryptography.*; class MyMainClass { public static void main(String[] args) { // Insert your file names into this method call. DecodeFromFile("c:\\encoded.txt", "c:\\roundtrip.txt"); } //main public static void DecodeFromFile(String inFileName, String outFileName) { FromBase64Transform myTransform = new FromBase64Transform(FromBase64TransformMode.IgnoreWhiteSpaces); ubyte myOutputBytes[] = new ubyte[myTransform.get_OutputBlockSize()]; // Open the input and output files. FileStream myInputFile = new FileStream(inFileName, FileMode.Open, FileAccess.Read); FileStream myOutputFile = new FileStream(outFileName, FileMode.Create, FileAccess.Write); // Retrieve the file contents into a byte array. // const int temp = 2; ubyte myInputBytes[] = new ubyte[(new Long(myInputFile.get_Length())).intValue()]; myInputFile.Read(myInputBytes, 0, myInputBytes.length); // Transform the data in chunks the size of InputBlockSize. int i = 0; while (myInputBytes.length - i > 4/*myTransform.InputBlockSize*/) { myTransform.TransformBlock(myInputBytes, i, 4/*myTransform.InputBlockSize*/, myOutputBytes, 0); i += 4 /*myTransform.InputBlockSize*/; myOutputFile.Write(myOutputBytes, 0, myTransform.get_OutputBlockSize()); } // Transform the final block of data. myOutputBytes = myTransform.TransformFinalBlock(myInputBytes, i, myInputBytes.length - i); myOutputFile.Write(myOutputBytes, 0, myOutputBytes.length); // Free up any used resources. myTransform.Clear(); myInputFile.Close(); myOutputFile.Close(); } //DecodeFromFile } //MyMainClass

Windows 98, Windows 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
開発プラットフォームの中には、.NET Framework によってサポートされていないバージョンがあります。サポートされているバージョンについては、「システム要件」を参照してください。


FromBase64Transform プロパティ
名前 | 説明 | |
---|---|---|
![]() | CanReuseTransform | 現在の変換を再利用できるかどうかを示す値を取得します。 |
![]() | CanTransformMultipleBlocks | 複数のブロックを変換できるかどうかを示す値を取得します。 |
![]() | InputBlockSize | 入力ブロック サイズを取得します。 |
![]() | OutputBlockSize | 出力ブロック サイズを取得します。 |

FromBase64Transform メソッド
名前 | 説明 | |
---|---|---|
![]() | Clear | FromBase64Transform によって使用されているすべてのリソースを解放します。 |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 ( Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 ( Object から継承されます。) |
![]() | TransformBlock | 入力バイト配列の指定した領域を base 64 から変換し、その結果を出力バイト配列の指定した領域にコピーします。 |
![]() | TransformFinalBlock | 指定したバイト配列の指定した領域を base 64 から変換します。 |

名前 | 説明 | |
---|---|---|
![]() | Dispose | FromBase64Transform によって使用されているアンマネージ リソースを解放し、オプションでマネージ リソースも解放します。 |
![]() | Finalize | オーバーライドされます。 FromBase64Transform によって使用されているアンマネージ リソースを解放します。 |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 ( Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | System.IDisposable.Dispose | FromBase64Transform によって使用されているアンマネージ リソースを解放し、オプションでマネージ リソースも解放します。 |

FromBase64Transform メンバ
base 64 から CryptoStream を変換します。
FromBase64Transform データ型で公開されるメンバを以下の表に示します。


名前 | 説明 | |
---|---|---|
![]() | CanReuseTransform | 現在の変換を再利用できるかどうかを示す値を取得します。 |
![]() | CanTransformMultipleBlocks | 複数のブロックを変換できるかどうかを示す値を取得します。 |
![]() | InputBlockSize | 入力ブロック サイズを取得します。 |
![]() | OutputBlockSize | 出力ブロック サイズを取得します。 |

名前 | 説明 | |
---|---|---|
![]() | Clear | FromBase64Transform によって使用されているすべてのリソースを解放します。 |
![]() | Equals | オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。) |
![]() | GetHashCode | 特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。) |
![]() | GetType | 現在のインスタンスの Type を取得します。 (Object から継承されます。) |
![]() | ReferenceEquals | 指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。) |
![]() | ToString | 現在の Object を表す String を返します。 (Object から継承されます。) |
![]() | TransformBlock | 入力バイト配列の指定した領域を base 64 から変換し、その結果を出力バイト配列の指定した領域にコピーします。 |
![]() | TransformFinalBlock | 指定したバイト配列の指定した領域を base 64 から変換します。 |

名前 | 説明 | |
---|---|---|
![]() | Dispose | FromBase64Transform によって使用されているアンマネージ リソースを解放し、オプションでマネージ リソースも解放します。 |
![]() | Finalize | オーバーライドされます。 FromBase64Transform によって使用されているアンマネージ リソースを解放します。 |
![]() | MemberwiseClone | 現在の Object の簡易コピーを作成します。 (Object から継承されます。) |

名前 | 説明 | |
---|---|---|
![]() | System.IDisposable.Dispose | FromBase64Transform によって使用されているアンマネージ リソースを解放し、オプションでマネージ リソースも解放します。 |

- FromBase64Transformのページへのリンク