utilium
    Preparing search index...

    Class Resource<ID>Internal

    The cache for a specific resource

    Type Parameters

    • ID
    Index

    Constructors

    Properties

    Accessors

    Methods

    Constructors

    Properties

    _size: number
    id: ID

    The resource ID

    options: Options
    regions: Region[] = []

    Regions used to reduce unneeded allocations. Think of sparse arrays.

    Accessors

    • get size(): number

      The full size of the resource

      Returns number

    • set size(value: number): void

      Parameters

      • value: number

      Returns void

    Methods

    • Add new data to the cache at given specified offset

      Parameters

      • data: Uint8Array
      • offset: number

      Returns this

    • Get the cached sub-ranges of an initial range. This is conceptually the inverse of missing.

      Parameters

      • start: number
      • end: number

      Returns Range[]

    • Combines adjacent regions and combines adjacent ranges within a region

      Returns void

    • Takes an initial range and finds the sub-ranges that are not in the cache

      Parameters

      • start: number
      • end: number

      Returns Range[]

    • Get the region who's ranges include an offset

      Parameters

      • offset: number

      Returns undefined | Region