Options
All
  • Public
  • Public/Protected
  • All
Menu

Represents a data file on the deno platform.

Hierarchy

Index

Constructors

Properties

Accessors

Methods

Constructors

constructor

Properties

Private file

file: File

Deno's internal file handle representation.

Private info

info: FileInfo

Information about this file.

Accessors

byteLength

  • get byteLength(): Promise<number>

Methods

close

  • close(): void
  • Closes the local file handle for the current platform. After this function is called all subsequent operations on this file, or any other data sources depending on this file, will fail.

    Returns void

loadData

  • loadData(start?: number, end?: number): Promise<ArrayBuffer>
  • Loads the file into an ArrayBuffer. Optionally a start and end can be specified to load a part of the file.

    Parameters

    • start: number = 0

      The offset at which the data will start loading

    • end: number = ...

      The offset at which the data will stop loading

    Returns Promise<ArrayBuffer>

Private loadDataIntoBuffer

  • loadDataIntoBuffer(buffer: Uint8Array, offset: number, start: number, end: number): Promise<number>
  • Loads data into a buffer with the specified parameters.

    Parameters

    • buffer: Uint8Array

      The buffer in which the data will be loaded. It must be large enough to fit the data requested

    • offset: number

      The byte offset within the buffer at which the data will be written

    • start: number

      The byte offset within the file where data will be read

    • end: number

      The byte offset within the file at which the data will stop being read

    Returns Promise<number>

slice

  • Slices the file and returns a data chunk pointing at the data within the specified boundaries.

    Parameters

    • start: number

      Pointer to the start of the data in bytes

    • end: number

      Pointer to the end of the data in bytes

    Returns DataSource

Static fromSource

Generated using TypeDoc