Class: FileData

core.Filesystem.FileData

Class representing file data for reading or writing.

new core.Filesystem.FileData (dataSource)

Creates a new FileData object from the given data source.

Name Type Description
dataSource string | ArrayBuffer | ReadableStream | Blob | FileInfo

The data source.

Properties:
Name Type Description
size number

The data size in bytes.

mimetype string

The MIME type of the data.

Methods

arrayBuffer ()Promise.<ArrayBuffer> async

Returns a promise that resolves to the data as ArrayBuffer.

Returns:
Type Description
Promise.<ArrayBuffer> A promise that resolves to an ArrayBuffer.

blob ()Blob

Returns a Blob with the data.

Returns:
Type Description
Blob A Blob with the data.

Returns a sliced version of this FileData object.

Name Type Description
from number

The start position in bytes of the slice.

to number

The (non-inclusive) end position in bytes of the slice.

Returns:
Type Description
core.Filesystem.FileData A new FileData object.

stream ()ReadStream

Returns a readable stream for reading from the data.

Returns:
Type Description
ReadStream A readable stream.

text ()Promise.<string> async

Returns a Promise that resolves to a string with the data.

Returns:
Type Description
Promise.<string> A Promise that resolves to a string.