@obsidize/tar-browserify
    Preparing search index...

    Class UstarHeaderField<T>

    Definitions taken from here: https://en.wikipedia.org/wiki/Tar_(computing)

    Type Parameters

    • T

    Implements

    Index

    Constructors

    Properties

    constantValue: any
    name: keyof UstarHeaderLike
    offset: number
    size: number
    deviceMajorNumber: UstarHeaderField<string> = ...
    deviceMinorNumber: UstarHeaderField<string> = ...
    fileMode: UstarHeaderField<number> = ...
    fileName: UstarHeaderField<string> = ...
    fileNamePrefix: UstarHeaderField<string> = ...
    fileSize: UstarHeaderField<number> = ...
    groupUserId: UstarHeaderField<number> = ...
    headerChecksum: UstarHeaderField<number> = ...
    lastModified: UstarHeaderField<number> = ...
    linkedFileName: UstarHeaderField<string> = ...
    ownerGroupName: UstarHeaderField<string> = ...
    ownerUserId: UstarHeaderField<number> = ...
    ownerUserName: UstarHeaderField<string> = ...
    typeFlag: UstarHeaderField<string> = ...
    ustarIndicator: UstarHeaderField<string> = ...
    ustarVersion: UstarHeaderField<string> = ...

    Methods

    • Calculates the checksum value for this field in the given input buffer, at the given offset. All field checksum values are aggregated together to form the main header checksum entry.

      Parameters

      • input: Uint8Array

        the input buffer to extract a field checksum from

      • offset: number = 0

        the offset of the header in the buffer (will be combined with this field's offset)

      Returns number

      the checksum value for this specific field

    • Parameters

      • input: Uint8Array

        a buffer of one or more complete tar sectors

      • offset: number = 0

      Returns undefined | T

      The value parsed from the input based on this field's transform type, or undefined on error.

    • Runs deserialize() while also taking this field's offset into account.

      Parameters

      • input: Uint8Array
      • offset: number

      Returns undefined | T

    • Parameters

      • input: T

        the value to be serialized, based on this field's transform type.

      Returns Uint8Array

      the serialized value as a Uint8Array

    • Parameters

      • input: Uint8Array

        a buffer of one or more complete tar sectors

      • offset: number = 0

        the offset to slice from (must be a multiple of SECTOR_SIZE)

      Returns Uint8Array

      the slice of the given input Uint8Array that this field resides in.

    • Shorthand for padding the output of slice into decodeString.

      Parameters

      • input: Uint8Array
      • Optionaloffset: number

      Returns string

    • Serialize the given value and set the output bytes in the given output buffer.

      Parameters

      • output: Uint8Array

        the output buffer to be written to

      • headerOffset: number

        the offset of the header in the output buffer to insert the update. Note that this field's offset will be added to the header offset when inserting.

      • value: T

        the value to be serialized

      Returns boolean

      true if the buffer was updated