public static MemoryStream ReadAsMemoryStream([NotNull] this Stream s) { var m = new MemoryStream(); s.CopyTo(m); return m; }