MemoryStream имеет один поток записи в него и другой чтения

Вот как я пишу в поток, а затем читаю из него, используя 1 поток:

        System.IO.MemoryStream ms = new System.IO.MemoryStream();

        // write to it
        ms.Write(new byte[] { 1, 2, 3, 4, 5, 6, 7 }, 0, 7);

        // go to the begining
        ms.Seek(0, System.IO.SeekOrigin.Begin);

        // now read from it
        byte[] myBuffer = new byte[7];
        ms.Read(myBuffer, 0, 7);

Now I was wondering if it is possible to write to the memory-stream from one thread and read that stream from a separate thread.

Ответы на вопрос(1)

Ваш ответ на вопрос