MemoryStream | CF 1.0, ECMA 1.0, serializable, marshal by reference, disposable |
System.IO (mscorlib.dll) | class |
This class is a stream
that keeps its data in memory as
opposed to on the disk (as a FileStream does). In
addition to the Stream methods, ToArray(
) writes the entire stream to a byte array, and
WriteTo( ) dumps the contents of this stream to a
different one.
public class MemoryStream : Stream {
// Public Constructors
public MemoryStream( );
public MemoryStream(byte[ ] buffer);
public MemoryStream(byte[ ] buffer, bool writable);
public MemoryStream(byte[ ] buffer, int index, int count);
public MemoryStream(byte[ ] buffer, int index, int count, bool writable);
public MemoryStream(byte[ ] buffer, int index, int count, bool writable,
bool publiclyVisible);
public MemoryStream(int capacity);
// Public Instance Properties
public override bool CanRead{get; }
// overrides Stream
public override bool CanSeek{get; }
// overrides Stream
public override bool CanWrite{get; }
// overrides Stream
public virtual int Capacity{set; get; }
public override long Length{get; }
// overrides Stream
public override long Position{set; get; }
// overrides Stream
// Public Instance Methods
public override void Close( );
// overrides Stream
public override void Flush( );
// overrides Stream
public virtual byte[ ] GetBuffer( );
public override int Read(in byte[ ] buffer, int offset, int count)
// overrides Stream
public override int ReadByte( );
// overrides Stream
public override long Seek(long offset, SeekOrigin loc);
// overrides Stream
public override void SetLength(long value);
// overrides Stream
public virtual byte[ ] ToArray( );
public override void Write(byte[ ] buffer, int offset, int count)
// overrides Stream
public override void WriteByte(byte value);
// overrides Stream
public virtual void WriteTo(Stream stream);
}
Hierarchy
System.Object
System.MarshalByRefObject
Stream(System.IDisposable)
MemoryStream
|