mscorlib 2.0.0.0 2.0.0.0 4.0.0.0 System.IO.Stream

This class supports access to unmanaged memory using the existing stream-based model and does not require that the contents in the unmanaged memory be copied to the heap.

Provides access to unmanaged blocks of memory from managed code.

- Constructor
  2.0.0.0
  4.0.0.0
  To be added.

  Initializes a new instance of the class.

- Constructor
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)

  This constructor creates a new instance of the class, and by default sets the property to false and the property to true. The property is set to the value of the parameter and cannot be changed.

  Initializes a new instance of the class using the specified location and memory length.

  A pointer to an unmanaged memory location.
  The length of the memory to use.
- Constructor
  4.0.0.0
  To be added.

  Initializes a new instance of the class in a safe buffer with a specified offset and length.

  The buffer to contain the unmanaged memory stream.
  The byte position in the buffer at which to start the unmanaged memory stream.
  The length of the unmanaged memory stream.
- Constructor
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)

  The parameter defines the current amount of memory in use. If reading or appending data to the stream, the value should be equal to the amount of valid data in the stream to be read from or preserved. If writing to the stream, this value should be zero.

  The parameter indicates the amount of total memory available. This value can describe a region that is longer than the length specified, or indicate a region that can be appended to. Any attempt to write beyond this value will fail.

  The parameter sets the , and properties. Note that specifying does not guarantee that the stream will be writable. The access parameters allow the implementer to create an object whose implementation can match the actual stream that is exposed.

  Initializes a new instance of the class using the specified location, memory length, total amount of memory, and file access values.

  A pointer to an unmanaged memory location.
  The length of the memory to use.
  The total amount of memory assigned to the stream.
  One of the values.
- Constructor
  4.0.0.0
  To be added.

  Initializes a new instance of the class in a safe buffer with a specified offset, length, and file access.

  The buffer to contain the unmanaged memory stream.
  The byte position in the buffer at which to start the unmanaged memory stream.
  The length of the unmanaged memory stream.
  The mode of file access to the unmanaged memory stream.
- Property
  2.0.0.0
  4.0.0.0
  System.Boolean To be added.

  This property indicates whether the current stream object supports reading.

  Gets a value indicating whether a stream supports reading.

- Property
  2.0.0.0
  4.0.0.0
  System.Boolean To be added.

  This property indicates whether the current stream object supports seeking.

  Gets a value indicating whether a stream supports seeking.

- Property
  2.0.0.0
  4.0.0.0
  System.Boolean To be added.

  This property indicates whether the current stream object supports writing.

  Gets a value indicating whether a stream supports writing.

- Property
  2.0.0.0
  4.0.0.0
  System.Int64 To be added.

  This property returns the value provided to the constructor. If no value was specified when the stream was initialized, this property returns the stream length.

  Gets the stream length (size) or the total amount of memory assigned to a stream (capacity).

- Method
  2.0.0.0
  4.0.0.0
  System.Void ``

  This method is called by the public method and the method. invokes the protected method with the parameter set to true. invokes with set to false.

  When the parameter is true, this method releases all resources held by any managed objects that this references. This method invokes the method of each referenced object.

  Releases the unmanaged resources used by the and optionally releases the managed resources.

  true to release both managed and unmanaged resources; false to release only unmanaged resources.
- Method
  2.0.0.0
  4.0.0.0
  System.Void

  This method performs no action for this class but is included as part of the base class. Since any data is written to RAM, this method is redundant.

  Overrides the method so that no action is performed.

- Method
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Void `` `` `` ``

  This method is equivalent to the constructor. It supports methods that need to initialize the pointer before setting stream variables and, therefore, cannot call the parameterized constructor. Such methods should use the default constructor, , initialize the pointer, and then invoke the method.

  Initializes a new instance of the class by using a pointer to an unmanaged memory location.

  A pointer to an unmanaged memory location. The length of the memory to use. The total amount of memory assigned to the stream. One of the values.
- Method
  4.0.0.0
  System.Void `` `` `` `` To be added.

  Initializes a new instance of the class in a safe buffer with a specified offset, length, and file access.

  The buffer to contain the unmanaged memory stream. The byte position in the buffer at which to start the unmanaged memory stream. The length of the unmanaged memory stream. The mode of file access to the unmanaged memory stream.
- Property
  2.0.0.0
  4.0.0.0
  System.Int64 To be added.

  If unchanged since the stream was initialized, this property returns the length value provided to the constructor. If changes to the stream have occurred, this property reflects any changes to the length of the data.

  Gets the length of the data in a stream.

- Property
  2.0.0.0
  4.0.0.0
  System.Int64 To be added.

  When a stream is initialized, this property is set to zero.

  Although you can set the position of the stream beyond the stream's capacity, you will not be able to access that area using the and methods. will return 0 and will throw a . This support is primarily for design and code compatibility with basic stream operations.

  Gets or sets the current position in a stream.

- Property
  2.0.0.0
  4.0.0.0
  System.CLSCompliant(false)
  System.Byte* To be added.

  To return a pointer to the entire stream, set the property to zero, and then call this property.

  Gets or sets a byte pointer to a stream based on the current position in the stream.

- Method
  2.0.0.0
  4.0.0.0
  System.Int32 `` `` ``

  The parameter gives the offset of the byte in the parameter (the buffer index) at which to begin reading, and the parameter gives the maximum number of bytes to be read from this stream. The returned value is the actual number of bytes read, or zero if the end of the stream is reached. If the read operation is successful, the current position of the stream is advanced by the number of bytes read. If an exception occurs, the current position of the stream is unchanged.

  The method returns zero only after reaching the end of the stream. Otherwise, always reads at least one byte from the stream before returning. If no data is available from the stream upon a call to , the method will block until at least one byte of data can be returned. An implementation is free to return fewer bytes than requested even if the end of the stream has not been reached.

  Reads the specified number of bytes into the specified array.

  The total number of bytes read into the buffer. This can be less than the number of bytes requested if that many bytes are not currently available, or zero (0) if the end of the stream has been reached.

  When this method returns, contains the specified byte array with the values between and ( + - 1) replaced by the bytes read from the current source. This parameter is passed uninitialized. The zero-based byte offset in at which to begin storing the data read from the current stream. The maximum number of bytes to read from the current stream.
- Method
  2.0.0.0
  4.0.0.0
  System.Int32

  Use this method to return integer values from the stream.

  Reads a byte from a stream and advances the position within the stream by one byte, or returns -1 if at the end of the stream.

  The unsigned byte cast to an object, or -1 if at the end of the stream.

- Method
  2.0.0.0
  4.0.0.0
  System.Int64 `` ``

  For more information about seeking, see .

  Sets the current position of the current stream to the given value.

  The new position in the stream.

  The point relative to to begin seeking from. Specifies the beginning, the end, or the current position as a reference point for , using a value of type .
- Method
  2.0.0.0
  4.0.0.0
  System.Void ``

  If the given value is less than the current length of the stream, the stream is truncated. If the given value is larger than the current length of the stream, the stream is expanded. If the stream is expanded, the contents of the stream between the old and the new lengths are undefined.

  A stream must support both writing and seeking for to work.

  Sets the length of a stream to a specified value.

  The length of the stream.
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` `` ``

  Writing occurs at the current position in the stream.

  Writes a block of bytes to the current stream using data from a buffer.

  The byte array from which to copy bytes to the current stream. The offset in the buffer at which to begin copying bytes to the current stream. The number of bytes to write to the current stream.
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` To be added.

  Writes a byte to the current position in the file stream.

  A byte value written to the stream.