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

MemoryStream クラス

バッキング ストアとしてメモリを使用するストリームを作成します。

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

<SerializableAttribute> _
<ComVisibleAttribute(True)> _
Public Class MemoryStream
    Inherits Stream
[SerializableAttribute] 
[ComVisibleAttribute(true)] 
public class MemoryStream : Stream
[SerializableAttribute] 
[ComVisibleAttribute(true)] 
public ref class MemoryStream : public
 Stream
/** @attribute SerializableAttribute() */ 
/** @attribute ComVisibleAttribute(true) */ 
public class MemoryStream extends Stream
SerializableAttribute 
ComVisibleAttribute(true) 
public class MemoryStream extends
 Stream
解説解説

ファイルの作成およびテキストのファイルへの書き込みの例については、「方法 : ファイルにテキストを書き込む」を参照してください。ファイルからのテキストの読み取りの例については、「方法 : ファイルからテキストを読み取る」を参照してください。バイナリ ファイルの読み取りおよび書き込みの例については、「方法 : 新しく作成されたデータ ファイルに対して読み書きする」を参照してください。

MemoryStream クラスは、バッキング ストアとしてディスクやネットワーク接続ではなく、メモリを使用するストリームを作成します。MemoryStream は、MemoryStream オブジェクトの作成時に初期化される符号なしバイト配列として格納されるデータをカプセル化します。配列は空の配列としても作成できます。カプセル化されたデータは、メモリで直接アクセスできます。メモリ ストリームを使用すると、アプリケーションでの一時バッファと一時ファイルの必要性を減らすことができます。

ストリームの current position は、次の読み取りまたは書き込み操作が実行される位置です。現在の位置は、Seek メソッドで取得または設定できます。MemoryStream の新しいインスタンスを作成するときに、現在の位置はゼロに設定されます。

符号なしバイト配列で作成したメモリ ストリームには、サイズを変更できないデータのストリーム ビュー機能が用意されています。これは書き込み専用です。バイト配列を使用する場合、ストリームに追加したり、ストリームを縮小したりできません。ただし、コンストラクタに渡すパラメータによっては、既存の内容を変更できることがあります。空のメモリ ストリームは、サイズの変更、書き込み、および読み取りを行うことができます。

MemoryStream オブジェクトを ResX ファイルまたは .resources ファイルに追加した場合、実行時に GetStream メソッドを呼び出してこのオブジェクトを取得します。

MemoryStream オブジェクトがリソース ファイルにシリアル化される場合、このオブジェクトは実際には UnmanagedMemoryStream としてシリアル化されます。これにより、パフォーマンスが向上するだけでなく、Stream メソッドを使用せずにデータへのポインタを直接取得できます。

Windows Mobile for Pocket PC、Windows Mobile for Smartphone、Windows CE プラットフォームメモ : Windows CE では、クリップボードから貼り付けられたメモリ ストリームは、クリップボードにコピーされたメモリ ストリームよりもわずかに大きなサイズを保持できます。元のメモリ ストリームの最後に追加のバイトを付加できるからです。メモリ ストリームを厳密に受け取るには、オブジェクトがメモリ ストリームを受け取る方法を判断するためのサイズをプレフィックスとしてオブジェクトに追加するか、メモリ ストリームとそのサイズの文字列値を含む DataObject をクリップボードにコピーします。

使用例使用例

メモリをバッキング ストアとして使用してデータを読み書きする方法の例を次に示します。

Imports System
Imports System.IO
Imports System.Text

Module MemStream

    Sub Main()
    
        Dim count As Integer
        Dim byteArray As Byte()
        Dim charArray As Char()
        Dim uniEncoding As New
 UnicodeEncoding()

        ' Create the data to write to the stream.
        Dim firstString As Byte()
 = _
            uniEncoding.GetBytes("Invalid file path characters
 are: ")
        Dim secondString As Byte()
 = _
            uniEncoding.GetBytes(Path.InvalidPathChars)

        Dim memStream As New
 MemoryStream(100)
        Try
            ' Write the first string to the stream.
            memStream.Write(firstString, 0 , firstString.Length)

            ' Write the second string to the stream, byte by byte.
            count = 0
            While(count < secondString.Length)
                memStream.WriteByte(secondString(count))
                count += 1
            End While
            
            ' Write the stream properties to the console.
            Console.WriteLine( _
                "Capacity = {0}, Length = {1}, Position = {2}",
 _
                memStream.Capacity.ToString(), _
                memStream.Length.ToString(), _
                memStream.Position.ToString())

            ' Set the stream position to the beginning of the stream.
            memStream.Seek(0, SeekOrigin.Begin)

            ' Read the first 20 bytes from the stream.
            byteArray = _
                New Byte(CType(memStream.Length,
 Integer)){}
            count = memStream.Read(byteArray, 0, 20)

            ' Read the remaining Bytes, Byte by Byte.
            While(count < memStream.Length)
                byteArray(count) = _
                    Convert.ToByte(memStream.ReadByte())
                count += 1
            End While

            ' Decode the Byte array into a Char array 
            ' and write it to the console.
            charArray = _
                New Char(uniEncoding.GetCharCount(
 _
                byteArray, 0, count)){}
            uniEncoding.GetDecoder().GetChars( _
                byteArray, 0, count, charArray, 0)
            Console.WriteLine(charArray)
        Finally
            memStream.Close()
        End Try

    End Sub
End Module
using System;
using System.IO;
using System.Text;

class MemStream
{
    static void Main()
    {
        int count;
        byte[] byteArray;
        char[] charArray;
        UnicodeEncoding uniEncoding = new UnicodeEncoding();

        // Create the data to write to the stream.
        byte[] firstString = uniEncoding.GetBytes(
            "Invalid file path characters are: ");
        byte[] secondString = uniEncoding.GetBytes(
            Path.InvalidPathChars);

        using(MemoryStream memStream = new
 MemoryStream(100))
        {
            // Write the first string to the stream.
            memStream.Write(firstString, 0 , firstString.Length);

            // Write the second string to the stream, byte by byte.
            count = 0;
            while(count < secondString.Length)
            {
                memStream.WriteByte(secondString[count++]);
            }

            // Write the stream properties to the console.
            Console.WriteLine(
                "Capacity = {0}, Length = {1}, Position = {2}\n",
                memStream.Capacity.ToString(), 
                memStream.Length.ToString(), 
                memStream.Position.ToString());

            // Set the position to the beginning of the stream.
            memStream.Seek(0, SeekOrigin.Begin);

            // Read the first 20 bytes from the stream.
            byteArray = new byte[memStream.Length];
            count = memStream.Read(byteArray, 0, 20);

            // Read the remaining bytes, byte by byte.
            while(count < memStream.Length)
            {
                byteArray[count++] = 
                    Convert.ToByte(memStream.ReadByte());
            }

            // Decode the byte array into a char array 
            // and write it to the console.
            charArray = new char[uniEncoding.GetCharCount(
                byteArray, 0, count)];
            uniEncoding.GetDecoder().GetChars(
                byteArray, 0, count, charArray, 0);
            Console.WriteLine(charArray);
        }
    }
}
using namespace System;
using namespace System::IO;
using namespace System::Text;

int main()
{
   int count;
   array<Byte>^byteArray;
   array<Char>^charArray;
   UnicodeEncoding^ uniEncoding = gcnew UnicodeEncoding;

   // Create the data to write to the stream.
   array<Byte>^firstString = uniEncoding->GetBytes( "Invalid file path
 characters are: " );
   array<Byte>^secondString = uniEncoding->GetBytes( Path::InvalidPathChars
 );

   MemoryStream^ memStream = gcnew MemoryStream( 100 );
   try
   {
      // Write the first string to the stream.
      memStream->Write( firstString, 0, firstString->Length );

      // Write the second string to the stream, byte by byte.
      count = 0;
      while ( count < secondString->Length )
      {
         memStream->WriteByte( secondString[ count++ ] );
      }

      
      // Write the stream properties to the console.
      Console::WriteLine( "Capacity = {0}, Length = {1}, "
      "Position = {2}\n", memStream->Capacity.ToString(), memStream->Length.ToString(),
 memStream->Position.ToString() );

      // Set the stream position to the beginning of the stream.
      memStream->Seek( 0, SeekOrigin::Begin );

      // Read the first 20 bytes from the stream.
      byteArray = gcnew array<Byte>(memStream->Length);
      count = memStream->Read( byteArray, 0, 20 );

      // Read the remaining bytes, byte by byte.
      while ( count < memStream->Length )
      {
         byteArray[ count++ ] = Convert::ToByte( memStream->ReadByte() );
      }
      
      // Decode the Byte array into a Char array 
      // and write it to the console.
      charArray = gcnew array<Char>(uniEncoding->GetCharCount( byteArray,
 0, count ));
      uniEncoding->GetDecoder()->GetChars( byteArray, 0, count, charArray,
 0 );
      Console::WriteLine( charArray );
   }
   finally
   {
      memStream->Close();
   }
}
import System.*;
import System.IO.*;
import System.Text.*;

class MemStream
{   
    public static void main(String[]
 args)
    {
        int count;
        ubyte byteArray[];
        char charArray[];
        UnicodeEncoding uniEncoding =  new UnicodeEncoding();

        // Create the data to write to the stream.
        ubyte firstString[] = uniEncoding.GetBytes(
            "Invalid file path characters are: ");
        ubyte secondString[] = uniEncoding.GetBytes(Path.InvalidPathChars);
        MemoryStream memStream =  new MemoryStream(100);
        try {
            // Write the first string to the stream.
            memStream.Write(firstString, 0, firstString.length);
            
            // Write the second string to the stream, byte by byte.
            count = 0;
            while((count < secondString.length)) {
                memStream.WriteByte(secondString[count++]);
            }

            // Write the stream properties to the console.
            Console.WriteLine(
                "Capacity = {0}, Length = {1}, Position = {2}\n", 
                (new Integer( memStream.get_Capacity())).ToString()
,
                (new Long ( memStream.get_Length())).ToString()
,
                (new Long ( memStream.get_Position())).ToString());

            // Set the position to the beginning of the stream.
            memStream.Seek(0, SeekOrigin.Begin);

            // Read the first 20 bytes from the stream.
            byteArray = new ubyte[(int)memStream.get_Length()];
            count = memStream.Read(byteArray, 0, 20);

            // Read the remaining bytes, byte by byte.
            while ((count < memStream.get_Length())) {
                byteArray[count++]= Convert.ToByte(memStream.ReadByte());
            }

            // Decode the byte array into a char array 
            // and write it to the console.
            charArray = new char[uniEncoding.GetCharCount(byteArray
,
                0, count)];
            uniEncoding.GetDecoder().GetChars(byteArray, 0, 
                count, charArray, 0);
            Console.WriteLine(charArray);
        }
        finally {
            memStream.Dispose();
        }
    }//main
} //MemStream
継承階層継承階層
System.Object
   System.MarshalByRefObject
     System.IO.Stream
      System.IO.MemoryStream
スレッド セーフスレッド セーフ
この型の public static (Visual Basic では Shared) メンバはすべて、スレッド セーフです。インスタンス メンバの場合は、スレッド セーフであるとは限りません。
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

MemoryStream コンストラクタ ()

MemoryStream クラスの新しいインスタンスを、0 に初期化される拡張可能な容量を使用して初期化します。

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

public MemoryStream ()
public:
MemoryStream ()
public MemoryStream ()
public function MemoryStream ()
解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

MemoryStream コンストラクタ (Byte[], Boolean)

CanWrite プロパティを指定どおりに設定し、指定したバイト配列に基づいて、サイズを変更できない MemoryStream クラスの新しいインスタンスを初期化します。

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

Public Sub New ( _
    buffer As Byte(), _
    writable As Boolean _
)
Dim buffer As Byte()
Dim writable As Boolean

Dim instance As New MemoryStream(buffer,
 writable)
public MemoryStream (
    byte[] buffer,
    bool writable
)
public:
MemoryStream (
    array<unsigned char>^ buffer, 
    bool writable
)
public MemoryStream (
    byte[] buffer, 
    boolean writable
)
public function MemoryStream (
    buffer : byte[], 
    writable : boolean
)

パラメータ

buffer

このストリームの作成元の符号なしバイトの配列。

writable

ストリームが書き込みをサポートするかどうかを決定する CanWrite プロパティの設定。

例外例外
例外の種類条件

ArgumentNullException

buffer が null 参照 (Visual Basic では Nothing) です。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

MemoryStream コンストラクタ (Byte[], Int32, Int32)

バイト配列の指定した領域 (インデックス) に基づいて、サイズを変更できない MemoryStream クラスの新しいインスタンスを初期化します。

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

例外例外
例外の種類条件

ArgumentNullException

buffer が null 参照 (Visual Basic では Nothing) です。

ArgumentOutOfRangeException

index または count が 0 未満です。

ArgumentException

index と count の合計値が、buffer の長さを超えています。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

MemoryStream コンストラクタ (Byte[], Int32, Int32, Boolean, Boolean)

指定した CanWrite プロパティと指定した GetBuffer を呼び出す機能を設定して、バイト配列の指定した領域に基づき、MemoryStream クラスの新しいインスタンスを初期化します。

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

Public Sub New ( _
    buffer As Byte(), _
    index As Integer, _
    count As Integer, _
    writable As Boolean, _
    publiclyVisible As Boolean _
)
Dim buffer As Byte()
Dim index As Integer
Dim count As Integer
Dim writable As Boolean
Dim publiclyVisible As Boolean

Dim instance As New MemoryStream(buffer,
 index, count, writable, publiclyVisible)
public MemoryStream (
    byte[] buffer,
    int index,
    int count,
    bool writable,
    bool publiclyVisible
)
public:
MemoryStream (
    array<unsigned char>^ buffer, 
    int index, 
    int count, 
    bool writable, 
    bool publiclyVisible
)
public MemoryStream (
    byte[] buffer, 
    int index, 
    int count, 
    boolean writable, 
    boolean publiclyVisible
)
public function MemoryStream (
    buffer : byte[], 
    index : int, 
    count : int, 
    writable : boolean, 
    publiclyVisible : boolean
)

パラメータ

buffer

このストリームの作成元の符号なしバイトの配列。

index

ストリームが開始する位置の buffer のインデックス。

count

バイト単位のストリーム長。

writable

ストリームが書き込みをサポートするかどうかを決定する CanWrite プロパティの設定。

publiclyVisible

ストリームが作成した符号なしバイト配列を返す GetBuffer を有効にする場合は true。それ以外の場合は false。

例外例外
例外の種類条件

ArgumentNullException

buffer が null 参照 (Visual Basic では Nothing) です。

ArgumentOutOfRangeException

index または count が負の値です。

ArgumentException

バッファ長から index を差し引いた値が count より小さい値です。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

MemoryStream コンストラクタ (Int32)

MemoryStream クラスの新しいインスタンスを、指定に従って初期化される拡張可能な容量を使用して初期化します。

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

例外例外
例外の種類条件

ArgumentOutOfRangeException

capacity が負の値です。

解説解説
使用例使用例

このコード例は、MemoryStream クラスのトピックで取り上げているコード例の一部分です。

Dim memStream As New MemoryStream(100)
using(MemoryStream memStream = new MemoryStream(100))
MemoryStream^ memStream = gcnew MemoryStream( 100 );
MemoryStream memStream =  new MemoryStream(100);
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

MemoryStream コンストラクタ (Byte[])

指定したバイト配列に基づいて、サイズを変更できない MemoryStream クラスの新しいインスタンスを初期化します。

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

例外例外
例外の種類条件

ArgumentNullException

buffer が null 参照 (Visual Basic では Nothing) です。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

MemoryStream コンストラクタ (Byte[], Int32, Int32, Boolean)

CanWrite プロパティを指定どおりに設定し、バイト配列の指定した領域に基づいて、サイズを変更できない MemoryStream クラスの新しいインスタンスを初期化します。

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

例外例外
例外の種類条件

ArgumentNullException

buffer が null 参照 (Visual Basic では Nothing) です。

ArgumentOutOfRangeException

index または count が負の値です。

ArgumentException

index と count の合計値が、buffer の長さを超えています。

解説解説
プラットフォームプラットフォーム
バージョン情報バージョン情報
参照参照

MemoryStream コンストラクタ

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

名前 説明
MemoryStream () MemoryStream クラスの新しいインスタンスを、0 に初期化される拡張可能な容量を使用して初期化します。

.NET Compact Framework によってサポートされています。

MemoryStream (Byte[]) 指定したバイト配列に基づいて、サイズを変更できない MemoryStream クラスの新しいインスタンスを初期化します。

.NET Compact Framework によってサポートされています。

MemoryStream (Int32) MemoryStream クラスの新しいインスタンスを、指定に従って初期化される拡張可能な容量を使用して初期化します。

.NET Compact Framework によってサポートされています。

MemoryStream (Byte[], Boolean) CanWrite プロパティを指定どおりに設定し、指定したバイト配列に基づいて、サイズを変更できない MemoryStream クラスの新しいインスタンスを初期化します。

.NET Compact Framework によってサポートされています。

MemoryStream (Byte[], Int32, Int32) バイト配列の指定した領域 (インデックス) に基づいて、サイズを変更できない MemoryStream クラスの新しいインスタンスを初期化します。

.NET Compact Framework によってサポートされています。

MemoryStream (Byte[], Int32, Int32, Boolean) CanWrite プロパティを指定どおりに設定し、バイト配列の指定した領域に基づいて、サイズを変更できない MemoryStream クラスの新しいインスタンスを初期化します。

.NET Compact Framework によってサポートされています。

MemoryStream (Byte[], Int32, Int32, Boolean, Boolean) 指定した CanWrite プロパティと指定した GetBuffer を呼び出す機能を設定して、バイト配列の指定した領域に基づき、MemoryStream クラスの新しいインスタンスを初期化します。

.NET Compact Framework によってサポートされています。

参照参照

MemoryStream プロパティ


MemoryStream メソッド


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

( プロテクト メソッド も参照)
  名前 説明
パブリック メソッド BeginRead  非同期の読み込み動作を開始します。 ( Stream から継承されます。)
パブリック メソッド BeginWrite  非同期の書き込み操作を開始します。 ( Stream から継承されます。)
パブリック メソッド Close  現在のストリームを閉じ、現在のストリームに関連付けられているすべてのリソース (ソケット、ファイル ハンドルなど) を解放します。 ( Stream から継承されます。)
パブリック メソッド CreateObjRef  リモート オブジェクトとの通信に使用するプロキシの生成に必要な情報をすべて格納しているオブジェクトを作成します。 ( MarshalByRefObject から継承されます。)
パブリック メソッド Dispose オーバーロードされます。  
パブリック メソッド EndRead  保留中の非同期読み取りが完了するまで待機します。 ( Stream から継承されます。)
パブリック メソッド EndWrite  非同期書き込み操作を終了します。 ( Stream から継承されます。)
パブリック メソッド Equals  オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 ( Object から継承されます。)
パブリック メソッド Flush オーバーライドされます。 操作が実行されないように、Stream.Flush をオーバーライドします。
パブリック メソッド GetBuffer このストリームの作成元の符号なしバイトの配列を返します。
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 ( Object から継承されます。)
パブリック メソッド GetLifetimeService  対象のインスタンスの有効期間ポリシーを制御する、現在の有効期間サービス オブジェクトを取得します。 ( MarshalByRefObject から継承されます。)
パブリック メソッド GetType  現在のインスタンスの Type を取得します。 ( Object から継承されます。)
パブリック メソッド InitializeLifetimeService  対象のインスタンスの有効期間ポリシーを制御する、有効期間サービス オブジェクトを取得します。 ( MarshalByRefObject から継承されます。)
パブリック メソッド Read オーバーライドされます。 現在のストリームからバイトのブロックを読み取り、データを buffer に書き込みます。
パブリック メソッド ReadByte オーバーライドされます。 現在のストリームからバイトを読み取ります。
パブリック メソッド ReferenceEquals  指定した複数の Object インスタンスが同一かどうかを判断します。 ( Object から継承されます。)
パブリック メソッド Seek オーバーライドされます。 現在のストリーム内の位置を指定した値に設定します。
パブリック メソッド SetLength オーバーライドされます。 現在のストリーム長を指定した値に設定します。
パブリック メソッド Synchronized  指定した Stream オブジェクトをラップするスレッド セーフな (同期された) ラッパーを作成します。 ( Stream から継承されます。)
パブリック メソッド ToArray Position プロパティには関係なく、ストリームの内容をバイト配列に書き込みます。
パブリック メソッド ToString  現在の Object を表す String を返します。 ( Object から継承されます。)
パブリック メソッド Write オーバーライドされます。 バッファから読み取ったデータを使用して、現在のストリームにバイトのブロックを書き込みます。
パブリック メソッド WriteByte オーバーライドされます。 現在のストリーム内の現在位置に 1 バイトを書き込みます。
パブリック メソッド WriteTo メモリ ストリームの内容全体を別のストリームに書き込みます。
プロテクト メソッドプロテクト メソッド
参照参照

MemoryStream メンバ

バッキング ストアとしてメモリを使用するストリームを作成します。

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


パブリック コンストラクタパブリック コンストラクタ
パブリック プロパティパブリック プロパティ
パブリック メソッドパブリック メソッド
( プロテクト メソッド も参照)
  名前 説明
パブリック メソッド BeginRead  非同期の読み込み動作を開始します。 (Stream から継承されます。)
パブリック メソッド BeginWrite  非同期の書き込み操作を開始します。 (Stream から継承されます。)
パブリック メソッド Close  現在のストリームを閉じ、現在のストリームに関連付けられているすべてのリソース (ソケット、ファイル ハンドルなど) を解放します。 (Stream から継承されます。)
パブリック メソッド CreateObjRef  リモート オブジェクトとの通信に使用するプロキシの生成に必要な情報をすべて格納しているオブジェクトを作成します。 (MarshalByRefObject から継承されます。)
パブリック メソッド Dispose オーバーロードされます。  
パブリック メソッド EndRead  保留中の非同期読み取りが完了するまで待機します。 (Stream から継承されます。)
パブリック メソッド EndWrite  非同期書き込み操作を終了します。 (Stream から継承されます。)
パブリック メソッド Equals  オーバーロードされます。 2 つの Object インスタンスが等しいかどうかを判断します。 (Object から継承されます。)
パブリック メソッド Flush オーバーライドされます。 操作が実行されないように、Stream.Flush をオーバーライドします。
パブリック メソッド GetBuffer このストリームの作成元の符号なしバイトの配列を返します。
パブリック メソッド GetHashCode  特定の型のハッシュ関数として機能します。GetHashCode は、ハッシュ アルゴリズムや、ハッシュ テーブルのようなデータ構造での使用に適しています。 (Object から継承されます。)
パブリック メソッド GetLifetimeService  対象のインスタンスの有効期間ポリシーを制御する、現在の有効期間サービス オブジェクトを取得します。 (MarshalByRefObject から継承されます。)
パブリック メソッド GetType  現在のインスタンスの Type を取得します。 (Object から継承されます。)
パブリック メソッド InitializeLifetimeService  対象のインスタンスの有効期間ポリシーを制御する、有効期間サービス オブジェクトを取得します。 (MarshalByRefObject から継承されます。)
パブリック メソッド Read オーバーライドされます。 現在のストリームからバイトのブロックを読み取り、データを buffer に書き込みます。
パブリック メソッド ReadByte オーバーライドされます。 現在のストリームからバイトを読み取ります。
パブリック メソッド ReferenceEquals  指定した複数の Object インスタンスが同一かどうかを判断します。 (Object から継承されます。)
パブリック メソッド Seek オーバーライドされます。 現在のストリーム内の位置を指定した値に設定します。
パブリック メソッド SetLength オーバーライドされます。 現在のストリーム長を指定した値に設定します。
パブリック メソッド Synchronized  指定した Stream オブジェクトをラップするスレッド セーフな (同期された) ラッパーを作成します。 (Stream から継承されます。)
パブリック メソッド ToArray Position プロパティには関係なく、ストリームの内容をバイト配列に書き込みます。
パブリック メソッド ToString  現在の Object を表す String を返します。 (Object から継承されます。)
パブリック メソッド Write オーバーライドされます。 バッファから読み取ったデータを使用して、現在のストリームにバイトのブロックを書き込みます。
パブリック メソッド WriteByte オーバーライドされます。 現在のストリーム内の現在位置に 1 バイトを書き込みます。
パブリック メソッド WriteTo メモリ ストリームの内容全体を別のストリームに書き込みます。
プロテクト メソッドプロテクト メソッド
参照参照



英和和英テキスト翻訳

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

辞書ショートカット

すべての辞書の索引

「MemoryStream」の関連用語

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

   

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



MemoryStreamのページの著作権

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

©2026 GRAS Group, Inc.RSS