Write() public method

public Write ( byte buffer, int offset, int count ) : void
buffer byte
offset int
count int
return void
        static void Main()
        {
            MyStream ms = new MyStream();

            ms.Read(new byte[] { }, 0, 0);
            ms.Write(new byte[] { }, 0, 0);
            ms.Flush();
            Console.WriteLine("See log.txt for details");

            Console.ReadKey();
        }
Ejemplo n.º 2
0
 public override void Write(byte[] buffer, int offset, int count)
 {
     AssertInvariants();
     Contracts.Check(!_disposed, "Stream already disposed");
     Contracts.CheckValue(buffer, nameof(buffer));
     Contracts.CheckParam(0 <= offset && offset <= buffer.Length, nameof(offset));
     Contracts.CheckParam(0 <= count && count <= buffer.Length - offset, nameof(count));
     if (IsMemory && _memStream.Position > _overflowBoundary - count)
     {
         EnsureOverflow();
     }
     MyStream.Write(buffer, offset, count);
     AssertInvariants();
 }