VOOZH about

URL: https://www.geeksforgeeks.org/node-js/node-js-buffer-byteoffset-property/

⇱ Node.js Buffer.byteOffset Property - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Node.js Buffer.byteOffset Property

Last Updated : 23 Jan, 2023

The Buffer.byteOffset property is an inbuilt application programming interface of class Buffer within buffer module which is used to get the byte offset value of this buffer.

Syntax:

const Buffer.byteOffset

Return Value: This property return the object of array buffer.

Example 1: Filename: index.js

Output:

byteoffset is : 0

Example 2: Filename: index.js

Output:

Int8Arry object : 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0

Run the index.js file using the following command:

node index.js

Reference: https://nodejs.org/dist/latest-v12.x/docs/api/buffer.html#buffer_buf_byteoffset

Comment

Explore