import BaseObject from "./baseObject"; import { ByteVector } from "../../byteVector"; import { ObjectType } from "../constants"; import { File } from "../../file"; /** * This class provides a representation of an ASF padding object which can be read from and * written to disk. */ export default class PaddingObject extends BaseObject { /** * Length of the padding object header in bytes. */ static readonly HEADER_LENGTH = 24; private _size; private constructor(); /** * Constructs and initializes a new instance by reading it from a file. * @param file File to read the padding object from * @param position Index into the file where the padding object starts from */ static fromFile(file: File, position: number): PaddingObject; /** * Constructs and initializes a new instance with a fixed size. * @param size Number of padding bytes to store in the object not including the size of the * header */ static fromSize(size: number): PaddingObject; /** @inheritDoc */ get objectType(): ObjectType; /** * Gets the number of bytes the current instance will take up on disk. Note: this does *not* * include the header for the object. */ get size(): number; /** * Sets the number of padding bytes the current instance will contain. Note: this does *not* * include the header for the object. * @param value Size of the current instance in bytes, must be a safe, positive integer. */ set size(value: number); /** @inheritDoc */ render(): ByteVector; }