<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ru">
		<id>http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2FFile_Stream%2FBufferedStream</id>
		<title>Csharp/C Sharp/File Stream/BufferedStream - История изменений</title>
		<link rel="self" type="application/atom+xml" href="http://nfex.ru/index.php?action=history&amp;feed=atom&amp;title=Csharp%2FC_Sharp%2FFile_Stream%2FBufferedStream"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/File_Stream/BufferedStream&amp;action=history"/>
		<updated>2026-04-29T15:10:09Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp/File_Stream/BufferedStream&amp;diff=1304&amp;oldid=prev</id>
		<title> в 15:31, 26 мая 2010</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/File_Stream/BufferedStream&amp;diff=1304&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:19Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class=&quot;diff diff-contentalign-left&quot; data-mw=&quot;interface&quot;&gt;
				&lt;tr style=&quot;vertical-align: top;&quot; lang=&quot;ru&quot;&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;← Предыдущая&lt;/td&gt;
				&lt;td colspan=&quot;1&quot; style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;Версия 15:31, 26 мая 2010&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; style=&quot;text-align: center;&quot; lang=&quot;ru&quot;&gt;&lt;div class=&quot;mw-diff-empty&quot;&gt;(нет различий)&lt;/div&gt;
&lt;/td&gt;&lt;/tr&gt;&lt;/table&gt;</summary>
			</entry>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp/File_Stream/BufferedStream&amp;diff=1305&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp/File_Stream/BufferedStream&amp;diff=1305&amp;oldid=prev"/>
				<updated>2010-05-26T11:45:36Z</updated>
		
		<summary type="html">&lt;p&gt;1 версия&lt;/p&gt;
&lt;p&gt;&lt;b&gt;Новая страница&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==Create a FileStream for the BufferedStream.==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
&lt;br /&gt;
using System;&lt;br /&gt;
using System.IO;&lt;br /&gt;
class BufStreamApp&lt;br /&gt;
{&lt;br /&gt;
    static void Main(string[] args)&lt;br /&gt;
    {&lt;br /&gt;
        FileStream fs = new FileStream(&amp;quot;Hoo.txt&amp;quot;,FileMode.Create, FileAccess.ReadWrite);&lt;br /&gt;
        BufferedStream bs = new BufferedStream(fs);&lt;br /&gt;
        Console.WriteLine(&amp;quot;Length: {0}\tPosition: {1}&amp;quot;,bs.Length, bs.Position);&lt;br /&gt;
   &lt;br /&gt;
        for (int i = 0; i &amp;lt; 64; i++)&lt;br /&gt;
        {&lt;br /&gt;
            bs.WriteByte((byte)i);&lt;br /&gt;
        }&lt;br /&gt;
        Console.WriteLine(&amp;quot;Length: {0}\tPosition: {1}&amp;quot;, bs.Length, bs.Position);&lt;br /&gt;
        byte[] ba = new byte[bs.Length];&lt;br /&gt;
        bs.Position = 0;&lt;br /&gt;
        bs.Read(ba, 0, (int)bs.Length);&lt;br /&gt;
        foreach (byte b in ba)&lt;br /&gt;
        {&lt;br /&gt;
            Console.Write(&amp;quot;{0,-3}&amp;quot;, b);&lt;br /&gt;
        }&lt;br /&gt;
   &lt;br /&gt;
        string s = &amp;quot;Foo&amp;quot;;&lt;br /&gt;
        for (int i = 0; i &amp;lt; 3; i++)&lt;br /&gt;
        {&lt;br /&gt;
            bs.WriteByte((byte)s[i]);&lt;br /&gt;
        }&lt;br /&gt;
        Console.WriteLine(&amp;quot;\nLength: {0}\tPosition: {1}\t&amp;quot;,bs.Length, bs.Position);&lt;br /&gt;
   &lt;br /&gt;
        for (int i = 0; i &amp;lt; (256-67)+1; i++)&lt;br /&gt;
        {&lt;br /&gt;
            bs.WriteByte((byte)i);&lt;br /&gt;
        }&lt;br /&gt;
        Console.WriteLine(&amp;quot;\nLength: {0}\tPosition: {1}\t&amp;quot;, bs.Length, bs.Position);&lt;br /&gt;
   &lt;br /&gt;
        bs.Close();&lt;br /&gt;
    }&lt;br /&gt;
}&lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==illustrates use of BufferedStreams==&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
   &lt;br /&gt;
&amp;lt;source lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
/*&lt;br /&gt;
Mastering Visual C# .NET&lt;br /&gt;
by Jason Price, Mike Gunderloy&lt;br /&gt;
Publisher: Sybex;&lt;br /&gt;
ISBN: 0782129110&lt;br /&gt;
*/&lt;br /&gt;
 /*&lt;br /&gt;
  Example15_14.cs illustrates use of BufferedStreams&lt;br /&gt;
*/&lt;br /&gt;
using System;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using System.IO;&lt;br /&gt;
public class Example15_14 &lt;br /&gt;
{&lt;br /&gt;
    [STAThread]&lt;br /&gt;
  public static void Main() &lt;br /&gt;
  {&lt;br /&gt;
    // use an open file dialog to get a filename&lt;br /&gt;
    OpenFileDialog dlgOpen = new OpenFileDialog();&lt;br /&gt;
    dlgOpen.Title=&amp;quot;Select file to back up&amp;quot;;&lt;br /&gt;
    if (dlgOpen.ShowDialog() == DialogResult.OK)&lt;br /&gt;
    {&lt;br /&gt;
      // create the raw streams&lt;br /&gt;
      FileStream inStream = File.OpenRead(dlgOpen.FileName);&lt;br /&gt;
      FileStream outStream = &lt;br /&gt;
        File.OpenWrite(dlgOpen.FileName + &amp;quot;.bak&amp;quot;);&lt;br /&gt;
      // add a buffering layer&lt;br /&gt;
      BufferedStream bufInStream = new BufferedStream(inStream);&lt;br /&gt;
      BufferedStream bufOutStream = new BufferedStream(outStream);&lt;br /&gt;
      byte[] buf = new byte[4096];&lt;br /&gt;
      int bytesRead;&lt;br /&gt;
      // copy all data from in to out via the buffer layer&lt;br /&gt;
      while ((bytesRead = bufInStream.Read(buf, 0, 4096)) &amp;gt; 0)&lt;br /&gt;
        bufOutStream.Write(buf, 0, bytesRead);&lt;br /&gt;
      // clean up&lt;br /&gt;
      bufOutStream.Flush();&lt;br /&gt;
      bufOutStream.Close();&lt;br /&gt;
      bufInStream.Close();&lt;br /&gt;
      outStream.Close();&lt;br /&gt;
      inStream.Close();&lt;br /&gt;
    }&lt;br /&gt;
  }&lt;br /&gt;
}&lt;br /&gt;
&lt;br /&gt;
           &lt;br /&gt;
       &amp;lt;/source&amp;gt;&lt;/div&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	</feed>