Buffers in NodeJS

The term Buffer means an intermediate storage for storing data. Buffers have a limited or predefined storage.

A new buffer can be defined in a node as below.

var buf = new Buffer(‘Hello’, ‘utf8’);

If we console log above line then the output will be:

<Buffer 48 65 6c 6c 6f>

where each number is a pointing to each word in ‘Hello’

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s