Skip to main content

sdk.file_2.sdkfile.slice

Home > @matterway/sdk > File_2 > SdkFile > slice

File_2.SdkFile.slice() method

Returns a new File with only data in the given range of bytes.

Signature:

slice(start?: number, end?: number, type?: string): SdkFile;

Parameters

ParameterTypeDescription
startnumber(Optional) The start index of the byte range.
endnumber(Optional) The end index of the byte range.
typestring(Optional) The type of the sliced file. Default is an empty string.

Returns:

SdkFile

A new File object with the sliced data.