How to use the token-types.INT32_BE function in token-types

To help you get started, we’ve selected a few token-types examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sindresorhus / file-type / core.js View on Github external
async function readChunkHeader() {
			return {
				length: await tokenizer.readToken(Token.INT32_BE),
				type: await tokenizer.readToken(new Token.StringType(4, 'binary'))
			};
		}
github Borewit / music-metadata / lib / mp4 / AtomToken.ts View on Github external
public constructor(public len: number) {
    super(len, Token.INT32_BE);
  }
}
github Borewit / music-metadata / lib / mp4 / AtomToken.ts View on Github external
get(buf: Buffer, off: number): ITimeToSampleToken {
    return {
      count: Token.INT32_BE.get(buf, off + 0),
      duration: Token.INT32_BE.get(buf, off + 4)
    };
  }
};
github Borewit / music-metadata / lib / mp4 / AtomToken.ts View on Github external
public get(buf: Buffer, off: number): IStszAtom {

    const nrOfEntries = Token.INT32_BE.get(buf, off + 8);

    return {
      version: Token.INT8.get(buf, off),
      flags: Token.INT24_BE.get(buf, off + 1),
      sampleSize: Token.INT32_BE.get(buf, off + 4),
      numberOfEntries: nrOfEntries,
      entries: readTokenTable(buf, Token.INT32_BE, off + 12, this.len - 12, nrOfEntries)
    };
  }
}
github Borewit / music-metadata / lib / mp4 / AtomToken.ts View on Github external
get(buf: Buffer, off: number): ISoundSampleDescriptionVersion {
    return {
      version: Token.INT16_BE.get(buf, off),
      revision: Token.INT16_BE.get(buf, off + 2),
      vendor: Token.INT32_BE.get(buf, off + 4)
    };
  }
};