/// <summary>
 /// Writes data from the stream into the buffer, given offset and count.
 /// </summary>
 /// <param name="buffer">The buffer to write into.</param>
 /// <param name="offset">The offset into the buffer where data is read from.</param>
 /// <param name="count">The number of bytes to write.</param>
 public override void Write(byte[] buffer, int offset, int count)
 {
     SyncAwaiter.WaitSync(() => WriteAsync(buffer, offset, count));
 }
 /// <summary>
 /// Flush this instance.
 /// </summary>
 public override void Flush()
 {
     SyncAwaiter.WaitSync(() => FlushAsync(CancellationToken.None));
 }