mscorlib [00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00] 1.0.5000.0 2.0.0.0 4.0.0.0 Gtk# is thread aware, but not thread safe; See the <link location="node:gtk-sharp/programming/threads">Gtk# Thread Programming</link> for details. System.IO.Stream System.Runtime.InteropServices.ComVisible(true)

A buffer is a block of bytes in memory used to cache data, thereby reducing the number of calls to the operating system. Buffers improve read and write performance. A buffer can be used for either reading or writing, but never both simultaneously. The and methods of BufferedStream automatically maintain the buffer.

BufferedStream can be composed around certain types of streams. It provides implementations for reading and writing bytes to an underlying data source or repository. Use and for reading and writing other data types. BufferedStream is designed to prevent the buffer from slowing down input and output when the buffer is not needed. If you always read and write for sizes greater than the internal buffer size, then BufferedStream might not even allocate the internal buffer. BufferedStream also buffers reads and writes in a shared buffer. It is assumed that you will almost always be doing a series of reads or writes, but rarely alternate between the two of them.

Adds a buffering layer to read and write operations on another stream. This class cannot be inherited.

- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  A shared read/write buffer is allocated the first time a BufferedStream object is initialized with this constructor. The shared buffer is not used if all reads and writes are greater than or equal to .

  Initializes a new instance of the class with a default buffer size of 4096 bytes.

  The current stream.
- Constructor
  1.0.5000.0
  2.0.0.0
  4.0.0.0

  A shared read/write buffer is allocated the first time a BufferedStream object is initialized with this constructor. The shared buffer is not used if all reads and writes are greater than or equal to .

  Initializes a new instance of the class with the specified buffer size.

  The current stream.
  The buffer size in bytes.
- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean To be added.

  If a class derived from does not support reading, calls to the , , , , and the Peek methods of , , and throw a .

  If the stream is closed, this property returns false.

  Gets a value indicating whether the current stream supports reading.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean To be added.

  If a class derived from does not support seeking, calls to , , , and throw a .

  If the stream is closed, this property returns false.

  Gets a value indicating whether the current stream supports seeking.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Boolean To be added.

  If a class derived from does not support writing, a call to , , or throws a .

  If the stream is closed, this property returns false.

  Gets a value indicating whether the current stream supports writing.

- Method
  System.Void To be added. To be added. 1.0.5000.0
- Method
  2.0.0.0
  4.0.0.0
  System.Void `` To be added. To be added. To be added.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void

  Flushing the stream will not flush its underlying encoder unless you explicitly call Flush or .

  If you use the constructor, thus specifying the buffer size while creating the BufferedStream object, the content is flushed when it reaches the buffer size. For example, code such as BufferedStream bs = new BufferedStream(bs, 5) will flush the content when the buffer size reaches 5 bytes.

  All the read and write methods of BufferedStream automatically maintain the buffer, so there is no need to invoke Flush when switching back and forth between reading and writing.

  Clears all buffers for this stream and causes any buffered data to be written to the underlying device.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64 To be added. To be added.

  Gets the stream length in bytes.

- Property
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64 To be added.

  The get accessor invokes to obtain the current position within the underlying stream and then adjusts this value according to the current position within the buffer.

  The set accessor copies any data previously written to the buffer to the underlying stream, and then invokes .

  Seeking to any location beyond the length of the stream is supported.

  Gets the position within the current stream.

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

  The Read method will return 0 only if the end of the stream is reached. In all other cases, Read always reads at least one byte from the stream before returning. By definition, if no data is available from the stream upon a call to Read, the Read method returns 0 (the end of the stream is reached automatically). An implementation is free to return fewer bytes than requested even if the end of the stream has not been reached.

  Use for reading primitive data types.

  Copies bytes from the current buffered stream to an array.

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

  The buffer to which bytes are to be copied. The byte offset in the buffer at which to begin reading bytes. The number of bytes to be read.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int32 To be added.

  Reads a byte from the underlying stream and returns the byte cast to an int, or returns -1 if reading from the end of the stream.

  The byte cast to an int, or -1 if reading from the end of the stream.

- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Int64 `` ``

  If is negative, the new position will precede the position specified by by the number of bytes specified by . If is 0, the new position will be the position specified by . If is positive, the new position will follow the position specified by by the number of bytes specified by .

  When a object is the base stream for a object, calling the method can cause the position of the stream to no longer match the position of the internal buffer in the reader. To reset the internal buffer, call the method; however, this method slows performance and should be called only when absolutely necessary.

  Seeking to any location beyond the length of the stream is supported.

  Sets the position within the current buffered stream.

  The new position within the current buffered stream.

  A byte offset relative to . A value of type indicating the reference point from which to obtain the new position.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void ``

  The buffer is flushed before setting the length of the underlying data source or repository. If the specified value is less than the current length of the buffered stream, the buffered stream is truncated. If the specified value is larger than the current length of the buffered stream, the buffered stream is expanded. If the buffered stream is expanded, the contents of the buffered stream between the old and the new lengths are not defined.

  SetLength flushes any buffered writes if necessary.

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

  Sets the length of the buffered stream.

  An integer indicating the desired length of the current buffered stream in bytes.
- Method
  1.0.5000.0
  2.0.0.0
  4.0.0.0
  System.Void `` `` `` To be added.

  Copies bytes to the buffered stream and advances the current position within the buffered stream by the number of bytes written.

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

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

  A byte to write to the stream.