Creates a stream whose backing store is memory.

Hierarchy (view full)

Constructors

Accessors

  • get Length(): number
  • Gets the length of the stream in bytes.

    Returns number

    The length of the stream in bytes.

Methods

  • Casts this object to the specified type. Throws error on failure.

    Type Parameters

    • T1

      The target type of the cast.

    • T2

      The type of the object to cast.

    Parameters

    Returns T1

  • Determines whether the specified object is equal to the current object.

    Parameters

    • obj: any

      The object to compare with the current object.

    Returns boolean

    true if the specified object is equal to the current object; otherwise, false.

  • Serves as the default hash function.

    Returns number

    A hash code for the current object.

  • When overridden in a derived class, sets the position within the current stream.

    Parameters

    • offset: number | Int64

      A byte offset relative to the origin parameter.

    • origin: SeekOrigin

      A value of type System.IO.SeekOrigin indicating the reference point used to obtain the new position.

    Returns number

    The new position within the current stream.

  • Writes the stream contents to a byte array, regardless of the System.IO.MemoryStream.Position property.

    Returns TypedArray<number>

    A new byte array.

  • Returns a string that represents the current object.

    Returns string

    A string that represents the current object.

  • Casts this object to the specified type. Returns null on failure.

    Type Parameters

    • T1

      The target type of the cast.

    • T2

      The type of the object to cast.

    Parameters

    Returns null | T1

  • Determines whether the specified object instances are considered equal.

    Parameters

    • objA: any

      The first object to compare.

    • objB: any

      The second object to compare.

    Returns boolean

    true if the objects are considered equal; otherwise, false. If both objA and objB are null, the method returns true.