FromBase64Transform.TransformBlock メソッドとは? わかりやすく解説

Weblio 辞書 > コンピュータ > .NET Framework クラス ライブラリ リファレンス > FromBase64Transform.TransformBlock メソッドの意味・解説 

FromBase64Transform.TransformBlock メソッド

入力バイト配列指定した領域base 64 から変換しその結果出力バイト配列指定した領域コピーします

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

Public Function TransformBlock ( _
    inputBuffer As Byte(), _
    inputOffset As Integer, _
    inputCount As Integer, _
    outputBuffer As Byte(), _
    outputOffset As Integer _
) As Integer
Dim instance As FromBase64Transform
Dim inputBuffer As Byte()
Dim inputOffset As Integer
Dim inputCount As Integer
Dim outputBuffer As Byte()
Dim outputOffset As Integer
Dim returnValue As Integer

returnValue = instance.TransformBlock(inputBuffer, inputOffset, inputCount, outputBuffer,
 outputOffset)
public int TransformBlock (
    byte[] inputBuffer,
    int inputOffset,
    int inputCount,
    byte[] outputBuffer,
    int outputOffset
)
public:
virtual int TransformBlock (
    array<unsigned char>^ inputBuffer, 
    int inputOffset, 
    int inputCount, 
    array<unsigned char>^ outputBuffer, 
    int outputOffset
) sealed
public final int TransformBlock (
    byte[] inputBuffer, 
    int inputOffset, 
    int inputCount, 
    byte[] outputBuffer, 
    int outputOffset
)
public final function TransformBlock (
    inputBuffer : byte[], 
    inputOffset : int, 
    inputCount : int, 
    outputBuffer : byte[], 
    outputOffset : int
) : int

パラメータ

inputBuffer

base 64 から変換する入力

inputOffset

入力バイト配列内のデータ使用開始位置を示すオフセット

inputCount

データとして使用する入力バイト配列内のバイト数。

outputBuffer

結果書き込む先の出力

outputOffset

データ書き込み開始位置を示す出力バイト配列内のオフセット

戻り値
書き込むバイト数。

例外例外
例外種類条件

ObjectDisposedException

現在の FromBase64Transform は既に破棄されています。

使用例使用例
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 名前空間
その他の技術情報
暗号サービス


このページでは「.NET Framework クラス ライブラリ リファレンス」からFromBase64Transform.TransformBlock メソッドを検索した結果を表示しています。
Weblioに収録されているすべての辞書からFromBase64Transform.TransformBlock メソッドを検索する場合は、下記のリンクをクリックしてください。
 全ての辞書からFromBase64Transform.TransformBlock メソッド を検索

英和和英テキスト翻訳>> Weblio翻訳
英語⇒日本語日本語⇒英語
  

辞書ショートカット

すべての辞書の索引

FromBase64Transform.TransformBlock メソッドのお隣キーワード
検索ランキング

   

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



FromBase64Transform.TransformBlock メソッドのページの著作権
Weblio 辞書 情報提供元は 参加元一覧 にて確認できます。

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

©2025 GRAS Group, Inc.RSS