C# MemoryStream GetBuffer

Description

MemoryStream GetBuffer Returns the array of unsigned bytes from which this stream was created.

Syntax

MemoryStream.GetBuffer has the following syntax.


public virtual byte[] GetBuffer()

Returns

MemoryStream.GetBuffer method returns

Example


using System.IO;//from   w  ww . j  a v a2  s .  c  om
using System;
public class MainClass{
  public static void Main(String[] argv){  
    MemoryStream ms = new MemoryStream();
    System.Console.WriteLine(ms.GetBuffer().Length);
  }
}

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