1.

Mention some of the interactions you can make with buffer data?

Answer»
  • Convert Buffer to JSON
  • Reading from Buffers
  • Concatenating Buffers
  • Compare Buffers
  • Copy Buffer

Example:

How to convert BINARY EQUIVALENT of STREAM xyz to JSON format:

create a javascript file with following code.

var BUF = Buffer.from('xyz'); console.log(buf.toJSON());

in the first LINE buf is the variable and Buffer is the Buffer class. Using toJSON method we can convert code as shown in the result below.

Execute the code : Following is the result

{ type: 'Buffer', data: [ 120, 121, 122 ] }



Discussion

No Comment Found