using System; using System.Threading.Tasks; namespace VersOne.Epub { /// /// A reference for a file located outside of the EPUB archive which allows to read its content as a byte array. /// Unlike , this class contains only a reference to the file but doesn't contain its content. /// public class EpubRemoteByteContentFileRef : EpubRemoteContentFileRef { /// /// Initializes a new instance of the class with a specified content file key, a content type of the file reference, /// a MIME type of the file's content, and content downloader options. /// /// Metadata of this content file reference. /// A reference to the EPUB content loader which provides methods to download the content of this file. /// The parameter is null. /// The parameter is null. public EpubRemoteByteContentFileRef(EpubContentFileRefMetadata metadata, IEpubContentLoader epubContentLoader) : base(metadata, epubContentLoader) { } /// /// Gets the type of the content file which is always for remote byte content file references. /// public override EpubContentFileType ContentFileType => EpubContentFileType.BYTE_ARRAY; /// /// Downloads the whole content of the referenced file and returns it as a byte array. /// /// Content of the referenced file. public byte[] DownloadContent() { return DownloadContentAsBytes(); } /// /// Asynchronously downloads the whole content of the referenced file and returns it as a byte array. /// /// A task that represents the asynchronous download operation. The value of the TResult parameter contains the content of the referenced file. public Task DownloadContentAsync() { return DownloadContentAsBytesAsync(); } } }