class · System.IO
MemoryStream
public class System.IO.MemoryStream : System.IO.Stream
Bytes kept in an array that grows as it is written (or in a fixed array given to it).
- Kind
- class
- Namespace
- System.IO
- Assembly
- System.Core
- Access
- public
- Source file
Stream.ant
Inheritance
Constructors
Properties
How many bytes fit before it grows.
Methods
method Seek(offset: i64, origin: System.IO.SeekOrigin) -> i64
#
method Close() -> void
#
A copy of its bytes.
The array it keeps its bytes in (Length of them are the stream's).
method WriteTo(destination: System.IO.Stream) -> void
#
Writes all its bytes into destination.
Private and internal members (13)
Inherited members (12)
Flushmethod from StreamReadmethod from StreamWritemethod from StreamReadExactlymethod from StreamReadToEndmethod from StreamCopyTomethod from StreamCopyTomethod from StreamGetTypemethod from AnyUndescribedmethod from AnyToStringmethod from AnyHashmethod from Anydestroymethod from Any
Source
MemoryStream as Larva HIR, decompiled from its Larva HIR.
// Bytes kept in an array that grows as it is written (or in a fixed array given to it).
public class System.IO.MemoryStream : System.IO.Stream
{
field data: u8[]
field length: i32
field position: i32
field writable: bool
field growable: bool
field open: bool
// Where a write can go without the slow path: data.Length when open and writable, else 0.
field room: i32
// The throw is kept out of the methods that check (so they stay small enough to inline).
static method Closed() -> void
static method ReadOnly() -> void
method Check() -> void
// Room for at least `needed` bytes.
method Reserve(needed: i32) -> void
method Grow(needed: i32) -> void
method WriteByteSlow(value: u8) -> void
constructor MemoryStream()
constructor MemoryStream(capacity: i32)
// Over `buffer` (its bytes are the stream's, it does not grow).
constructor MemoryStream(buffer: u8[])
constructor MemoryStream(buffer: u8[], writable: bool)
method Read(buffer: u8[], offset: i32, count: i32) -> i32
method ReadByte() -> i32
method Write(buffer: u8[], offset: i32, count: i32) -> void
method WriteByte(value: u8) -> void
method Seek(offset: i64, origin: System.IO.SeekOrigin) -> i64
method SetLength(newLength: i64) -> void
method Close() -> void
// A copy of its bytes.
method ToArray() -> u8[]
// The array it keeps its bytes in (Length of them are the stream's).
method GetBuffer() -> u8[]
// Writes all its bytes into `destination`.
method WriteTo(destination: System.IO.Stream) -> void
property CanRead: bool
property CanWrite: bool
property CanSeek: bool
property Length: i64
property Position: i64
// How many bytes fit before it grows.
property Capacity: i32
}