Skip to main content
Buffer.writeIntBE - node__buffer.d.ts - Node documentation
method Buffer.writeIntBE

Usage in Deno

```typescript import { type Buffer } from "node:node__buffer.d.ts"; ```
Buffer.writeIntBE(
value: number,
offset: number,
byteLength: number,
): number
Writes `byteLength` bytes of `value` to `buf` at the specified `offset`as big-endian. Supports up to 48 bits of accuracy. Behavior is undefined when`value` is anything other than a signed integer. ```js import { Buffer } from 'node:buffer'; const buf = Buffer.allocUnsafe(6); buf.writeIntBE(0x1234567890ab, 0, 6); console.log(buf); // Prints: ```

Parameters

value: number
Number to be written to `buf`.
offset: number
Number of bytes to skip before starting to write. Must satisfy `0 <= offset <= buf.length - byteLength`.
byteLength: number
Number of bytes to write. Must satisfy `0 < byteLength <= 6`.

Return Type

number
`offset` plus the number of bytes written.