Class EpubLocalByteContentFileRef
A reference for a file within the EPUB archive which allows to read its content as a byte array. Unlike EpubLocalByteContentFile, this class contains only a reference to the file but doesn't contain its content.
Inherited Members
Namespace: VersOne.Epub
Assembly: VersOne.Epub.dll
Syntax
public class EpubLocalByteContentFileRef : EpubLocalContentFileRef
Constructors
View SourceEpubLocalByteContentFileRef(EpubContentFileRefMetadata, string, IEpubContentLoader)
Initializes a new instance of the EpubLocalByteContentFileRef class with a specified EPUB book reference, a file name, a content type of the file, and a MIME type of the file's content.
Declaration
public EpubLocalByteContentFileRef(EpubContentFileRefMetadata metadata, string filePath, IEpubContentLoader epubContentLoader)
Parameters
Type | Name | Description |
---|---|---|
EpubContentFileRefMetadata | metadata | Metadata of this content file reference. |
string | filePath | The absolute path of the local content file in the EPUB archive. |
IEpubContentLoader | epubContentLoader | A reference to the EPUB content loader which provides methods to load the content of this file. |
Exceptions
Type | Condition |
---|---|
ArgumentNullException | The |
ArgumentNullException | The |
ArgumentNullException | The |
Properties
View SourceContentFileType
Gets the type of the content file which is always BYTE_ARRAY for local byte content file references.
Declaration
public override EpubContentFileType ContentFileType { get; }
Property type: EpubContentFileType
Overrides
Methods
View SourceReadContent()
Reads the whole content of the referenced file and returns it as a byte array.
Declaration
public byte[] ReadContent()
Returns
Type | Description |
---|---|
byte[] | Content of the referenced file. |
ReadContentAsync()
Asynchronously reads the whole content of the referenced file and returns it as a byte array.
Declaration
public Task<byte[]> ReadContentAsync()
Returns
Type | Description |
---|---|
Task<byte[]> | A task that represents the asynchronous read operation. The value of the TResult parameter contains the content of the referenced file. |