using System.Text; namespace Beam.Models { public class ByteDocument : Document { public ByteDocument(string filename, byte[] content, Encoding? encoding = null) : base(filename, encoding) { Content = content; } public ByteDocument(string filename, Memory content, Encoding? encoding = null) : base(filename, encoding) { Content = content; } public Memory Content { get; set; } public override byte[] ToBytes() { return Content.ToArray(); } public override string ToString() { return Encoding.GetString(Content.ToArray()); } } }