<?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_by_API%2FSystem.IO%2FBufferedStream</id>
		<title>Csharp/C Sharp by API/System.IO/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_by_API%2FSystem.IO%2FBufferedStream"/>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp_by_API/System.IO/BufferedStream&amp;action=history"/>
		<updated>2026-04-30T18:40:13Z</updated>
		<subtitle>История изменений этой страницы в вики</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>http://nfex.ru/index.php?title=Csharp/C_Sharp_by_API/System.IO/BufferedStream&amp;diff=4999&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_by_API/System.IO/BufferedStream&amp;diff=4999&amp;oldid=prev"/>
				<updated>2010-05-26T15:31:35Z</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_by_API/System.IO/BufferedStream&amp;diff=5000&amp;oldid=prev</id>
		<title>Admin: 1 версия</title>
		<link rel="alternate" type="text/html" href="http://nfex.ru/index.php?title=Csharp/C_Sharp_by_API/System.IO/BufferedStream&amp;diff=5000&amp;oldid=prev"/>
				<updated>2010-05-26T12:12:34Z</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;==BufferedStream.Position==&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;
using System;&lt;br /&gt;
using System.IO;&lt;br /&gt;
    public class BufStrm&lt;br /&gt;
    {&lt;br /&gt;
        static public void Main ()&lt;br /&gt;
        {&lt;br /&gt;
            FileStream strm;&lt;br /&gt;
            strm = new FileStream (&amp;quot;test.txt&amp;quot;,FileMode.OpenOrCreate,FileAccess.Write);&lt;br /&gt;
            strm.SetLength (0);&lt;br /&gt;
            BufferedStream bstrm = new BufferedStream (strm);&lt;br /&gt;
            string str = &amp;quot;this is a test&amp;quot;;&lt;br /&gt;
            byte [] b;&lt;br /&gt;
            StringToByte (out b, str);&lt;br /&gt;
            bstrm.Write (b, 0, b.Length);&lt;br /&gt;
            long Pos = bstrm.Position;&lt;br /&gt;
            Console.WriteLine (&amp;quot;The buffered stream position is &amp;quot;+ bstrm.Position);&lt;br /&gt;
            Console.WriteLine (&amp;quot;The underlying stream position is &amp;quot;+ strm.Position);&lt;br /&gt;
            str = &amp;quot;the quick red fox jumps over the lazy brown dog.\r\n&amp;quot;;&lt;br /&gt;
            StringToByte (out b, str);&lt;br /&gt;
            bstrm.Write (b, 0, b.Length);&lt;br /&gt;
            Console.WriteLine (&amp;quot;\r\nThe buffered stream position is &amp;quot; +bstrm.Position);&lt;br /&gt;
            Console.WriteLine (&amp;quot;The underlying stream position is still &amp;quot;+ strm.Position);&lt;br /&gt;
            bstrm.Seek (Pos, SeekOrigin.Begin);&lt;br /&gt;
            b[0] = (byte) &amp;quot;T&amp;quot;;&lt;br /&gt;
            bstrm.Write (b, 0, 1);&lt;br /&gt;
            bstrm.Flush ();&lt;br /&gt;
            bstrm.Close ();&lt;br /&gt;
            strm.Close ();&lt;br /&gt;
        }&lt;br /&gt;
        static void StringToByte (out byte [] b, string str)&lt;br /&gt;
        {&lt;br /&gt;
            b = new byte [str.Length];&lt;br /&gt;
            for (int x = 0; x &amp;lt; str.Length; ++x)&lt;br /&gt;
            {&lt;br /&gt;
                b[x] = (byte) str [x];&lt;br /&gt;
            }&lt;br /&gt;
        }&lt;br /&gt;
    }&lt;br /&gt;
   &lt;br /&gt;
    &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==BufferedStream.Read==&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;
   &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==BufferedStream.Write==&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;
using System;&lt;br /&gt;
using System.Windows.Forms;&lt;br /&gt;
using System.IO;&lt;br /&gt;
public class MainClass &lt;br /&gt;
{&lt;br /&gt;
  public static void Main() &lt;br /&gt;
  {&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;
      FileStream inStream = File.OpenRead(dlgOpen.FileName);&lt;br /&gt;
      FileStream outStream = File.OpenWrite(dlgOpen.FileName + &amp;quot;.bak&amp;quot;);&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;
      while ((bytesRead = bufInStream.Read(buf, 0, 4096)) &amp;gt; 0)&lt;br /&gt;
        bufOutStream.Write(buf, 0, bytesRead);&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;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==BufferedStream.WriteByte==&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;
   &lt;br /&gt;
  &amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==new BufferedStream(FileStream fs)==&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;
using System;&lt;br /&gt;
using System.IO;&lt;br /&gt;
public class MainClass&lt;br /&gt;
{&lt;br /&gt;
    public static int Main(string[] args)&lt;br /&gt;
    {&lt;br /&gt;
    FileStream dumpFile = new FileStream(&amp;quot;Dump.dat&amp;quot;, FileMode.Create, FileAccess.ReadWrite);&lt;br /&gt;
    BufferedStream myFileBuffer = new BufferedStream(dumpFile);&lt;br /&gt;
    &lt;br /&gt;
    byte[] str = {127, 0x77, 0x4, 0x0, 0x0, 0x16};&lt;br /&gt;
    myFileBuffer.Write(str, 0, str.Length);&lt;br /&gt;
    // add changes to file.&lt;br /&gt;
    myFileBuffer.Close();  // Flushes.&lt;br /&gt;
    dumpFile.Close();  // Flushes.&lt;br /&gt;
    return 0;&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>