const header = Buffer.from([0, 0, 0, 4, 1, 0, 0, 0, 0]); console.log(header.readUIntBE(0, 3)); console.log(header[3]); console.log(header[4] & 1);