public void CanCreateBinaryDataFromBytes() { var payload = Encoding.UTF8.GetBytes("some data"); var data = new BinaryData(payload); Assert.AreEqual(payload, data.AsBytes().ToArray()); // using implicit conversion ReadOnlyMemory <byte> bytes = data; Assert.AreEqual(payload, bytes.ToArray()); }