C# MemoryStream MemoryStream(Int32)

Description

MemoryStream MemoryStream(Int32) Initializes a new instance of the MemoryStream class with an expandable capacity initialized as specified.

Syntax

MemoryStream.MemoryStream(Int32) has the following syntax.


public MemoryStream(
  int capacity
)

Parameters

MemoryStream.MemoryStream(Int32) has the following parameters.

  • capacity - The initial size of the internal array in bytes.

Example


using System.IO;//w w  w. ja  v a2  s.c om
using System;
public class MainClass{
  public static void Main(String[] argv){  
    MemoryStream ms = new MemoryStream(100);
    System.Console.WriteLine(ms.CanRead);
  }
}

The code above generates the following result.





















Home »
  C# Tutorial »
    System.IO »




BinaryReader
BinaryWriter
Directory
DirectoryInfo
DriveInfo
File
FileInfo
FileStream
MemoryStream
Path
StreamReader
StreamWriter
StringReader
StringWriter