FromBase64Transformとは? わかりやすく解説

FromBase64Transform クラス

base 64 から CryptoStream を変換します。

名前空間: System.Security.Cryptography
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

<ComVisibleAttribute(True)> _
Public Class FromBase64Transform
    Implements ICryptoTransform, IDisposable
Dim instance As FromBase64Transform
[ComVisibleAttribute(true)] 
public class FromBase64Transform : ICryptoTransform,
 IDisposable
[ComVisibleAttribute(true)] 
public ref 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.Object
  System.Security.Cryptography.FromBase64Transform
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
FromBase64Transform メンバ
System.Security.Cryptography 名前空間
その他の技術情報
暗号サービス

FromBase64Transform コンストラクタ ()


FromBase64Transform コンストラクタ

FromBase64Transform クラスの新しいインスタンスを初期化します。
オーバーロードの一覧オーバーロードの一覧

名前 説明
FromBase64Transform () FromBase64Transform クラスの新しいインスタンスを初期化します。
FromBase64Transform (FromBase64TransformMode) 変換モードを指定して、FromBase64Transform クラスの新しいインスタンスを初期化します。
参照参照

関連項目

FromBase64Transform クラス
FromBase64Transform メンバ
System.Security.Cryptography 名前空間

その他の技術情報

暗号サービス

FromBase64Transform コンストラクタ (FromBase64TransformMode)

変換モードを指定して、FromBase64Transform クラスの新しいインスタンスを初期化します。

名前空間: System.Security.Cryptography
アセンブリ: mscorlib (mscorlib.dll 内)
構文構文

Public Sub New ( _
    whitespaces As FromBase64TransformMode _
)
Dim whitespaces As FromBase64TransformMode

Dim instance As New FromBase64Transform(whitespaces)
public FromBase64Transform (
    FromBase64TransformMode whitespaces
)
public:
FromBase64Transform (
    FromBase64TransformMode whitespaces
)
public FromBase64Transform (
    FromBase64TransformMode whitespaces
)
public function FromBase64Transform (
    whitespaces : FromBase64TransformMode
)

パラメータ

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   
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照
関連項目
FromBase64Transform クラス
FromBase64Transform メンバ
System.Security.Cryptography 名前空間
その他の技術情報
暗号サービス

FromBase64Transform プロパティ


パブリック プロパティパブリック プロパティ

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

関連項目

FromBase64Transform クラス
System.Security.Cryptography 名前空間

その他の技術情報

暗号サービス

FromBase64Transform メソッド


パブリック メソッドパブリック メソッド

プロテクト メソッドプロテクト メソッド
  名前 説明
プロテクト メソッド Dispose FromBase64Transform によって使用されているアンマネージ リソースを解放し、オプションでマネージ リソースも解放します。
プロテクト メソッド Finalize オーバーライドされます。 FromBase64Transform によって使用されているアンマネージ リソースを解放します。
プロテクト メソッド MemberwiseClone  現在の Object の簡易コピーを作成します。 ( Object から継承されます。)
明示的インターフェイスの実装明示的インターフェイスの実装
  名前 説明
インターフェイスの明示的な実装 System.IDisposable.Dispose FromBase64Transform によって使用されているアンマネージ リソースを解放し、オプションでマネージ リソースも解放します。
参照参照

関連項目

FromBase64Transform クラス
System.Security.Cryptography 名前空間

その他の技術情報

暗号サービス

FromBase64Transform メンバ

base 64 から CryptoStream を変換します。

FromBase64Transform データ型で公開されるメンバを以下の表に示します。


パブリック コンストラクタパブリック コンストラクタ
  名前 説明
パブリック メソッド FromBase64Transform オーバーロードされます。 FromBase64Transform クラスの新しいインスタンスを初期化します。
パブリック プロパティパブリック プロパティ
  名前 説明
パブリック プロパティ CanReuseTransform 現在の変換を再利用できるかどうかを示す値を取得します。
パブリック プロパティ CanTransformMultipleBlocks 複数のブロックを変換できるかどうかを示す値を取得します。
パブリック プロパティ InputBlockSize 入力ブロック サイズを取得します。
パブリック プロパティ OutputBlockSize 出力ブロック サイズを取得します。
パブリック メソッドパブリック メソッド
プロテクト メソッドプロテクト メソッド
  名前 説明
プロテクト メソッド Dispose FromBase64Transform によって使用されているアンマネージ リソースを解放し、オプションでマネージ リソースも解放します。
プロテクト メソッド Finalize オーバーライドされます。 FromBase64Transform によって使用されているアンマネージ リソースを解放します。
プロテクト メソッド MemberwiseClone  現在の Object の簡易コピーを作成します。 (Object から継承されます。)
明示的インターフェイスの実装明示的インターフェイスの実装
  名前 説明
インターフェイスの明示的な実装 System.IDisposable.Dispose FromBase64Transform によって使用されているアンマネージ リソースを解放し、オプションでマネージ リソースも解放します。
参照参照

関連項目

FromBase64Transform クラス
System.Security.Cryptography 名前空間

その他の技術情報

暗号サービス



英和和英テキスト翻訳

英語⇒日本語日本語⇒英語

辞書ショートカット

すべての辞書の索引

「FromBase64Transform」の関連用語

FromBase64Transformのお隣キーワード
検索ランキング

   

英語⇒日本語
日本語⇒英語
   



FromBase64Transformのページの著作権

   
日本マイクロソフト株式会社日本マイクロソフト株式会社
© 2026 Microsoft.All rights reserved.

©2026 GRAS Group, Inc.RSS