VOOZH about

URL: https://www.geeksforgeeks.org/node-js/node-js-v8-serializer-writerawbytes-method/

⇱ Node.js v8.Serializer.writeRawBytes() Method - GeeksforGeeks


  • Courses
  • Tutorials
  • Interview Prep

Node.js v8.Serializer.writeRawBytes() Method

Last Updated : 22 Jul, 2020

The v8.Serializer.writeRawBytes() method is an inbuilt application programming interface of the v8.Serializer module which is used to write a raw buffer data to the internal buffer. For use inside of custom serializer._writeHostObject().

Syntax:

v8.Serializer.writeRawBytes( Buffer );

Parameters: This method accepts single parameter as mentioned above and described below:

  • Buffer: It is a required parameter, refers to a buffer/typed array/data view to be written to the internal buffer.

Return Value: This method does not return anything but writes raw buffer data to the internal buffer.

Below examples illustrate the use of v8.Serializer.writeRawBytes() method in Node.js.

Example 1: Filename: index.js Run index.js file using the following command:
node index.js

Output:

<Buffer ff 0d 49 ae 5a>
Example 2: Filename: index.js Run index.js file using the following command:
node index.js

Output:

<Buffer >
GeeksforGeeks

Reference: https://nodejs.org/api/v8.html#v8_serializer_writerawbytes_buffer

Comment
Article Tags:

Explore