C# MemoryStream CanWrite

Description

MemoryStream CanWrite Gets a value indicating whether the current stream supports writing.

Syntax

MemoryStream.CanWrite has the following syntax.


public override bool CanWrite { get; }

Example


using System;//from ww  w . j  a va 2  s  .co m
using System.IO;
public class MainClass{
  public static void Main(String[] argv){  
    MemoryStream ms = new MemoryStream();
    System.Console.WriteLine(ms.CanWrite);
  }
}

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