﻿<?xml version="1.0" encoding="utf-8"?><Type Name="BufferedStream" FullName="System.IO.BufferedStream"><TypeSignature Maintainer="auto" Language="C#" Value="public sealed class BufferedStream : System.IO.Stream" /><TypeSignature Language="ILAsm" Value=".class public auto ansi sealed beforefieldinit BufferedStream extends System.IO.Stream" /><AssemblyInfo><AssemblyName>mscorlib</AssemblyName><AssemblyPublicKey>[00 00 00 00 00 00 00 00 04 00 00 00 00 00 00 00]</AssemblyPublicKey><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ThreadSafetyStatement>Gtk# is thread aware, but not thread safe; See the &lt;link location="node:gtk-sharp/programming/threads"&gt;Gtk# Thread Programming&lt;/link&gt; for details.</ThreadSafetyStatement><Base><BaseTypeName>System.IO.Stream</BaseTypeName></Base><Interfaces></Interfaces><Attributes><Attribute><AttributeName>System.Runtime.InteropServices.ComVisible(true)</AttributeName></Attribute></Attributes><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>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 <see cref="M:System.IO.BufferedStream.Read(System.Byte[],System.Int32,System.Int32)" /> and <see cref="M:System.IO.BufferedStream.Write(System.Byte[],System.Int32,System.Int32)" /> methods of BufferedStream automatically maintain the buffer.</para><para>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 <see cref="T:System.IO.BinaryReader" /> and <see cref="T:System.IO.BinaryWriter" /> 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.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Adds a buffering layer to read and write operations on another stream. This class cannot be inherited.</para></summary></Docs><Members><Member MemberName=".ctor"><MemberSignature Language="C#" Value="public BufferedStream (System.IO.Stream stream);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.IO.Stream stream) cil managed" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue /><Parameters><Parameter Name="stream" Type="System.IO.Stream" /></Parameters><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>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 <paramref name="bufferSize" />.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Initializes a new instance of the <see cref="T:System.IO.BufferedStream" /> class with a default buffer size of 4096 bytes.</para></summary><param name="stream"><attribution license="cc4" from="Microsoft" modified="false" />The current stream. </param></Docs></Member><Member MemberName=".ctor"><MemberSignature Language="C#" Value="public BufferedStream (System.IO.Stream stream, int bufferSize);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig specialname rtspecialname instance void .ctor(class System.IO.Stream stream, int32 bufferSize) cil managed" /><MemberType>Constructor</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue /><Parameters><Parameter Name="stream" Type="System.IO.Stream" /><Parameter Name="bufferSize" Type="System.Int32" /></Parameters><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>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 <paramref name="bufferSize" />.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Initializes a new instance of the <see cref="T:System.IO.BufferedStream" /> class with the specified buffer size.</para></summary><param name="stream"><attribution license="cc4" from="Microsoft" modified="false" />The current stream. </param><param name="bufferSize"><attribution license="cc4" from="Microsoft" modified="false" />The buffer size in bytes. </param></Docs></Member><Member MemberName="CanRead"><MemberSignature Language="C#" Value="public override bool CanRead { get; }" /><MemberSignature Language="ILAsm" Value=".property instance bool CanRead" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Boolean</ReturnType></ReturnValue><Docs><value>To be added.</value><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>If a class derived from <see cref="T:System.IO.Stream" /> does not support reading, calls to the <see cref="M:System.IO.BufferedStream.Read(System.Byte[],System.Int32,System.Int32)" />, <see cref="M:System.IO.BufferedStream.ReadByte" />, <see cref="M:System.IO.Stream.BeginRead(System.Byte[],System.Int32,System.Int32,System.AsyncCallback,System.Object)" />, <see cref="M:System.IO.Stream.EndRead(System.IAsyncResult)" />, and the Peek methods of <see cref="T:System.IO.StreamReader" />, <see cref="T:System.IO.StringReader" />, and <see cref="T:System.IO.TextReader" /> throw a <see cref="T:System.NotSupportedException" />.</para><para>If the stream is closed, this property returns false.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Gets a value indicating whether the current stream supports reading.</para></summary></Docs></Member><Member MemberName="CanSeek"><MemberSignature Language="C#" Value="public override bool CanSeek { get; }" /><MemberSignature Language="ILAsm" Value=".property instance bool CanSeek" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Boolean</ReturnType></ReturnValue><Docs><value>To be added.</value><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>If a class derived from <see cref="T:System.IO.Stream" /> does not support seeking, calls to <see cref="P:System.IO.BufferedStream.Length" />, <see cref="M:System.IO.BufferedStream.SetLength(System.Int64)" />, <see cref="P:System.IO.BufferedStream.Position" />, and <see cref="M:System.IO.BufferedStream.Seek(System.Int64,System.IO.SeekOrigin)" /> throw a <see cref="T:System.NotSupportedException" />.</para><para>If the stream is closed, this property returns false.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Gets a value indicating whether the current stream supports seeking.</para></summary></Docs></Member><Member MemberName="CanWrite"><MemberSignature Language="C#" Value="public override bool CanWrite { get; }" /><MemberSignature Language="ILAsm" Value=".property instance bool CanWrite" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Boolean</ReturnType></ReturnValue><Docs><value>To be added.</value><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>If a class derived from <see cref="T:System.IO.Stream" /> does not support writing, a call to <see cref="M:System.IO.BufferedStream.SetLength(System.Int64)" />, <see cref="M:System.IO.BufferedStream.Write(System.Byte[],System.Int32,System.Int32)" />, or <see cref="M:System.IO.BufferedStream.WriteByte(System.Byte)" /> throws a <see cref="T:System.NotSupportedException" />.</para><para>If the stream is closed, this property returns false.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Gets a value indicating whether the current stream supports writing.</para></summary></Docs></Member><Member MemberName="Close"><MemberSignature Language="C#" Value="public override void Close ();" /><MemberType>Method</MemberType><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters /><Docs><summary>To be added.</summary><remarks>To be added.</remarks></Docs><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion></AssemblyInfo></Member><Member MemberName="Dispose"><MemberSignature Language="C#" Value="protected override void Dispose (bool disposing);" /><MemberSignature Language="ILAsm" Value=".method familyhidebysig virtual instance void Dispose(bool disposing) cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters><Parameter Name="disposing" Type="System.Boolean" /></Parameters><Docs><param name="disposing">To be added.</param><summary>To be added.</summary><remarks>To be added.</remarks></Docs></Member><Member MemberName="Flush"><MemberSignature Language="C#" Value="public override void Flush ();" /><MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance void Flush() cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters /><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>Flushing the stream will not flush its underlying encoder unless you explicitly call Flush or <see cref="M:System.IO.Stream.Close" />.</para><para>If you use the <see cref="M:System.IO.BufferedStream.#ctor(System.IO.Stream,System.Int32)" /> 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.</para><para>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.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Clears all buffers for this stream and causes any buffered data to be written to the underlying device.</para></summary></Docs></Member><Member MemberName="Length"><MemberSignature Language="C#" Value="public override long Length { get; }" /><MemberSignature Language="ILAsm" Value=".property instance int64 Length" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Int64</ReturnType></ReturnValue><Docs><value>To be added.</value><remarks>To be added.</remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Gets the stream length in bytes.</para></summary></Docs></Member><Member MemberName="Position"><MemberSignature Language="C#" Value="public override long Position { get; set; }" /><MemberSignature Language="ILAsm" Value=".property instance int64 Position" /><MemberType>Property</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Int64</ReturnType></ReturnValue><Docs><value>To be added.</value><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>The get accessor invokes <see cref="M:System.IO.BufferedStream.Seek(System.Int64,System.IO.SeekOrigin)" /> to obtain the current position within the underlying stream and then adjusts this value according to the current position within the buffer.</para><para>The set accessor copies any data previously written to the buffer to the underlying stream, and then invokes <see cref="M:System.IO.BufferedStream.Seek(System.Int64,System.IO.SeekOrigin)" />.</para><para>Seeking to any location beyond the length of the stream is supported.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Gets the position within the current stream.</para></summary></Docs></Member><Member MemberName="Read"><MemberSignature Language="C#" Value="public override int Read (byte[] array, int offset, int count);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 Read(unsigned int8[] array, int32 offset, int32 count) cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Int32</ReturnType></ReturnValue><Parameters><Parameter Name="array" Type="System.Byte[]" /><Parameter Name="offset" Type="System.Int32" /><Parameter Name="count" Type="System.Int32" /></Parameters><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>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.</para><para>Use <see cref="T:System.IO.BinaryReader" /> for reading primitive data types.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Copies bytes from the current buffered stream to an array.</para></summary><returns><attribution license="cc4" from="Microsoft" modified="false" /><para>The total number of bytes read into <paramref name="array" />. 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.</para></returns><param name="array"><attribution license="cc4" from="Microsoft" modified="false" />The buffer to which bytes are to be copied. </param><param name="offset"><attribution license="cc4" from="Microsoft" modified="false" />The byte offset in the buffer at which to begin reading bytes. </param><param name="count"><attribution license="cc4" from="Microsoft" modified="false" />The number of bytes to be read. </param></Docs></Member><Member MemberName="ReadByte"><MemberSignature Language="C#" Value="public override int ReadByte ();" /><MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int32 ReadByte() cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Int32</ReturnType></ReturnValue><Parameters /><Docs><remarks>To be added.</remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>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.</para></summary><returns><attribution license="cc4" from="Microsoft" modified="false" /><para>The byte cast to an int, or -1 if reading from the end of the stream.</para></returns></Docs></Member><Member MemberName="Seek"><MemberSignature Language="C#" Value="public override long Seek (long offset, System.IO.SeekOrigin origin);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance int64 Seek(int64 offset, valuetype System.IO.SeekOrigin origin) cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Int64</ReturnType></ReturnValue><Parameters><Parameter Name="offset" Type="System.Int64" /><Parameter Name="origin" Type="System.IO.SeekOrigin" /></Parameters><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>If <paramref name="offset" /> is negative, the new position will precede the position specified by <paramref name="origin" /> by the number of bytes specified by <paramref name="offset" />. If <paramref name="offset" /> is 0, the new position will be the position specified by <paramref name="origin" />. If <paramref name="offset" /> is positive, the new position will follow the position specified by <paramref name="origin" /> by the number of bytes specified by <paramref name="offset" />.</para><para>When a <see cref="T:System.IO.BufferedStream" /> object is the base stream for a <see cref="T:System.IO.StreamReader" /> object, calling the <see cref="M:System.IO.BufferedStream.Seek(System.Int64,System.IO.SeekOrigin)" /> 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 <see cref="M:System.IO.StreamReader.DiscardBufferedData" /> method; however, this method slows performance and should be called only when absolutely necessary.</para><para>Seeking to any location beyond the length of the stream is supported.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Sets the position within the current buffered stream.</para></summary><returns><attribution license="cc4" from="Microsoft" modified="false" /><para>The new position within the current buffered stream.</para></returns><param name="offset"><attribution license="cc4" from="Microsoft" modified="false" />A byte offset relative to <paramref name="origin" />. </param><param name="origin"><attribution license="cc4" from="Microsoft" modified="false" />A value of type <see cref="T:System.IO.SeekOrigin" /> indicating the reference point from which to obtain the new position. </param></Docs></Member><Member MemberName="SetLength"><MemberSignature Language="C#" Value="public override void SetLength (long value);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance void SetLength(int64 value) cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters><Parameter Name="value" Type="System.Int64" /></Parameters><Docs><remarks><attribution license="cc4" from="Microsoft" modified="false" /><para>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.</para><para>SetLength flushes any buffered writes if necessary.</para><para>A stream must support both writing and seeking for SetLength to work.</para></remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Sets the length of the buffered stream.</para></summary><param name="value"><attribution license="cc4" from="Microsoft" modified="false" />An integer indicating the desired length of the current buffered stream in bytes. </param></Docs></Member><Member MemberName="Write"><MemberSignature Language="C#" Value="public override void Write (byte[] array, int offset, int count);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance void Write(unsigned int8[] array, int32 offset, int32 count) cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters><Parameter Name="array" Type="System.Byte[]" /><Parameter Name="offset" Type="System.Int32" /><Parameter Name="count" Type="System.Int32" /></Parameters><Docs><remarks>To be added.</remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Copies bytes to the buffered stream and advances the current position within the buffered stream by the number of bytes written.</para></summary><param name="array"><attribution license="cc4" from="Microsoft" modified="false" />The byte array from which to copy <paramref name="count" /> bytes to the current buffered stream. </param><param name="offset"><attribution license="cc4" from="Microsoft" modified="false" />The offset in the buffer at which to begin copying bytes to the current buffered stream. </param><param name="count"><attribution license="cc4" from="Microsoft" modified="false" />The number of bytes to be written to the current buffered stream. </param></Docs></Member><Member MemberName="WriteByte"><MemberSignature Language="C#" Value="public override void WriteByte (byte value);" /><MemberSignature Language="ILAsm" Value=".method public hidebysig virtual instance void WriteByte(unsigned int8 value) cil managed" /><MemberType>Method</MemberType><AssemblyInfo><AssemblyVersion>1.0.5000.0</AssemblyVersion><AssemblyVersion>2.0.0.0</AssemblyVersion><AssemblyVersion>4.0.0.0</AssemblyVersion></AssemblyInfo><ReturnValue><ReturnType>System.Void</ReturnType></ReturnValue><Parameters><Parameter Name="value" Type="System.Byte" /></Parameters><Docs><remarks>To be added.</remarks><summary><attribution license="cc4" from="Microsoft" modified="false" /><para>Writes a byte to the current position in the buffered stream.</para></summary><param name="value"><attribution license="cc4" from="Microsoft" modified="false" />A byte to write to the stream. </param></Docs></Member></Members></Type>