Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface BulkFileHandle

A handle for accessing a bulk file.

Hierarchy

  • BulkFileHandle

Index

Properties

onAvailableSizeChange

onAvailableSizeChange: Event<number>

onStateChange

onStateChange: Event<BulkFileState>

This event is fired when the file has been completely downloaded or fails.

Methods

deref

  • deref(): void
  • Dereference this file.

    See ref() above.

    Returns void

getAvailableSize

  • getAvailableSize(): number
  • The number of bytes of the file which are available.

    This value can change when a file is being downloaded. See the event onAvailableSizeChange.

    Returns number

getMetadata

  • Get the metadata associated with the file.

    The keys are simply strings and are specific to the file type.

    Returns BulkFileMetadata

getState

getTotalSize

  • getTotalSize(): number
  • Get the complete size of the file.

    This may be -1 if the total size is unknown.

    Returns number

getUrl

  • getUrl(): string
  • Get a URL to the file contents.

    Returns string

peek1KB

  • peek1KB(): Buffer
  • Get the first 1KB of the file contents.

    Returns Buffer

    The first 1KB of file or less if the available size and/or total size is less than 1024.

ref

  • ref(): void
  • Reference the file and increment its internal reference count.

    Files are managed and deleted when unneeded by using a simple reference counting scheme. When a file handle is held it must also be referenced by calling this method. When a file handle is no longer needed, then the matching deref() method must be called.

    When a file's internal reference count transitions to zero, then the file may be cleaned up and removed on the next process tick.

    Returns void

Generated using TypeDoc