C# 클래스 nl.siegmann.epublib.domain.Resource

파일 보기 프로젝트 열기: lanfengqi/EpubLib-Sharp 1 사용 예제들

공개 메소드들

메소드 설명
Resource ( System stream, string href ) : System

Creates a resource with the data from the given InputStream at the specified href. The MediaType will be determined based on the href extension.

Resource ( byte data, MediaType mediaType ) : System

Creates a Resource with the given data and MediaType. The href will be automatically generated. Assumes that if the data is of a text type (html/css/etc) then the encoding will be UTF-8

Resource ( byte data, string href ) : System

Creates a resource with the given data at the specified href. The MediaType will be determined based on the href extension. Assumes that if the data is of a text type (html/css/etc) then the encoding will be UTF-8

Resource ( string href ) : System

Creates an empty Resource with the given href. Assumes that if the data is of a text type (html/css/etc) then the encoding will be UTF-8

Resource ( string id, byte data, string href, MediaType mediaType ) : System

Creates a resource with the given id, data, mediatype at the specified href. Assumes that if the data is of a text type (html/css/etc) then the encoding will be UTF-8

Resource ( string id, byte data, string href, MediaType mediaType, string inputEncoding ) : System

Creates a resource with the given id, data, mediatype at the specified href. If the data is of a text type (html/css/etc) then it will use the given inputEncoding.

Resource ( string fileName, long size, string href ) : System

Creates a Lazy resource, by not actually loading the data for this entry. The data will be loaded on the first call to getData()

close ( ) : void

Tells this resource to release its cached data. If this resource was not lazy- loaded, this is a no-op.

equals ( Object resourceObject ) : bool

Checks to see of the given resourceObject is a resource and whether its href is equal to this one.

getData ( ) : byte[]

The contents of the resource as a byte[] If this resource was lazy-loaded and the data was not yet loaded, it will be loaded into memory at this point. This included opening the zip file, so expect a first load to be slow.

getHref ( ) : string

The location of the resource within the contents folder of the epub file. Example:
images/cover.jpg
content/chapter1.xhtml

getId ( ) : string

The resources Id. Must be both unique within all the resources of this book and a valid identifier.

getInputEncoding ( ) : string

The character encoding of the resource. Is allowed to be null for non-text resources like images.

getInputStream ( ) : Stream

Gets the contents of the Resource as an InputStream.

getMediaType ( ) : MediaType

This resource's mediaType.

getSize ( ) : long

Returns the size of this resource in bytes.

getTitle ( ) : string

If the title is found by scanning the underlying html document then it is cached here.

hashCode ( ) : int

Gets the hashCode of the Resource's href.

isInitialized ( ) : bool

Returns if the data for this resource has been loaded into memory.

setData ( byte data ) : void

Sets the data of the Resource. If the data is a of a different type then the original data then make sure to change the MediaType.

setHref ( string href ) : void

Sets the Resource's href.

setId ( string id ) : void

Sets the Resource's id: Make sure it is unique and a valid identifier.

setInputEncoding ( string encoding ) : void

Sets the Resource's input character encoding.

setMediaType ( MediaType mediaType ) : void
setTitle ( string title ) : void
toString ( ) : string

메소드 상세

Resource() 공개 메소드

Creates a resource with the data from the given InputStream at the specified href. The MediaType will be determined based on the href extension.
public Resource ( System stream, string href ) : System
stream System
href string The location of the resource within the epub. Example: /// "cover.jpg".
리턴 System

Resource() 공개 메소드

Creates a Resource with the given data and MediaType. The href will be automatically generated. Assumes that if the data is of a text type (html/css/etc) then the encoding will be UTF-8
public Resource ( byte data, MediaType mediaType ) : System
data byte The Resource's contents
mediaType MediaType The MediaType of the Resource
리턴 System

Resource() 공개 메소드

Creates a resource with the given data at the specified href. The MediaType will be determined based on the href extension. Assumes that if the data is of a text type (html/css/etc) then the encoding will be UTF-8
public Resource ( byte data, string href ) : System
data byte The Resource's contents
href string The location of the resource within the epub. Example: /// "chapter1.html".
리턴 System

Resource() 공개 메소드

Creates an empty Resource with the given href. Assumes that if the data is of a text type (html/css/etc) then the encoding will be UTF-8
public Resource ( string href ) : System
href string The location of the resource within the epub. Example: /// "chapter1.html".
리턴 System

Resource() 공개 메소드

Creates a resource with the given id, data, mediatype at the specified href. Assumes that if the data is of a text type (html/css/etc) then the encoding will be UTF-8
public Resource ( string id, byte data, string href, MediaType mediaType ) : System
id string The id of the Resource. Internal use only. Will be auto- /// generated if it has a null-value.
data byte The Resource's contents
href string The location of the resource within the epub. Example: /// "chapter1.html".
mediaType MediaType The resources MediaType
리턴 System

Resource() 공개 메소드

Creates a resource with the given id, data, mediatype at the specified href. If the data is of a text type (html/css/etc) then it will use the given inputEncoding.
public Resource ( string id, byte data, string href, MediaType mediaType, string inputEncoding ) : System
id string The id of the Resource. Internal use only. Will be auto- /// generated if it has a null-value.
data byte The Resource's contents
href string The location of the resource within the epub. Example: /// "chapter1.html".
mediaType MediaType The resources MediaType
inputEncoding string If the data is of a text type (html/css/etc) then /// it will use the given inputEncoding.
리턴 System

Resource() 공개 메소드

Creates a Lazy resource, by not actually loading the data for this entry. The data will be loaded on the first call to getData()
public Resource ( string fileName, long size, string href ) : System
fileName string the fileName for the epub we're created from.
size long the size of this resource.
href string The resource's href within the epub.
리턴 System

close() 공개 메소드

Tells this resource to release its cached data. If this resource was not lazy- loaded, this is a no-op.
public close ( ) : void
리턴 void

equals() 공개 메소드

Checks to see of the given resourceObject is a resource and whether its href is equal to this one.
public equals ( Object resourceObject ) : bool
resourceObject Object
리턴 bool

getData() 공개 메소드

The contents of the resource as a byte[] If this resource was lazy-loaded and the data was not yet loaded, it will be loaded into memory at this point. This included opening the zip file, so expect a first load to be slow.
public getData ( ) : byte[]
리턴 byte[]

getHref() 공개 메소드

The location of the resource within the contents folder of the epub file. Example:
images/cover.jpg
content/chapter1.xhtml
public getHref ( ) : string
리턴 string

getId() 공개 메소드

The resources Id. Must be both unique within all the resources of this book and a valid identifier.
public getId ( ) : string
리턴 string

getInputEncoding() 공개 메소드

The character encoding of the resource. Is allowed to be null for non-text resources like images.
public getInputEncoding ( ) : string
리턴 string

getInputStream() 공개 메소드

Gets the contents of the Resource as an InputStream.
public getInputStream ( ) : Stream
리턴 System.IO.Stream

getMediaType() 공개 메소드

This resource's mediaType.
public getMediaType ( ) : MediaType
리턴 MediaType

getSize() 공개 메소드

Returns the size of this resource in bytes.
public getSize ( ) : long
리턴 long

getTitle() 공개 메소드

If the title is found by scanning the underlying html document then it is cached here.
public getTitle ( ) : string
리턴 string

hashCode() 공개 메소드

Gets the hashCode of the Resource's href.
public hashCode ( ) : int
리턴 int

isInitialized() 공개 메소드

Returns if the data for this resource has been loaded into memory.
public isInitialized ( ) : bool
리턴 bool

setData() 공개 메소드

Sets the data of the Resource. If the data is a of a different type then the original data then make sure to change the MediaType.
public setData ( byte data ) : void
data byte data
리턴 void

setHref() 공개 메소드

Sets the Resource's href.
public setHref ( string href ) : void
href string href
리턴 void

setId() 공개 메소드

Sets the Resource's id: Make sure it is unique and a valid identifier.
public setId ( string id ) : void
id string id
리턴 void

setInputEncoding() 공개 메소드

Sets the Resource's input character encoding.
public setInputEncoding ( string encoding ) : void
encoding string encoding
리턴 void

setMediaType() 공개 메소드

public setMediaType ( MediaType mediaType ) : void
mediaType MediaType
리턴 void

setTitle() 공개 메소드

public setTitle ( string title ) : void
title string
리턴 void

toString() 공개 메소드

public toString ( ) : string
리턴 string