using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Net.Sockets;

namespace BufferedStreamServer
{
    class Program
    {
        static void Main(string[] args)
        {
            //Server sendet Daten an den Client
            Console.WriteLine("Server");

            TcpClient serverSocket = new TcpClient("localhost", 9000);
            UnicodeEncoding ue = new UnicodeEncoding();
            byte[] writeBytes = ue.GetBytes("ABCDE"); //10Bytes

            NetworkStream ns = serverSocket.GetStream();
            Stream buffered = new BufferedStream(ns, 1);

            for (int i = 0; i < 10; i++)
            {
                buffered.Write(writeBytes, i, 1);
            }

            Console.ReadLine();
        }
    }
}
