Skip to content

Latest commit

 

History

History
84 lines (65 loc) · 2.08 KB

File metadata and controls

84 lines (65 loc) · 2.08 KB
layout default
menu_item api
title Buf
description Version 0.19.0
return_to
API Documentation Index
/api/
sections
#containsNul #free #grow #isBinary #set Instance Variables
#containsNul
#free
#grow
#isBinary
#set
#ivars

Buf#containsNul SyncExperimental

var result = buf.containsNul();
Returns
Number 1 if buffer contains a NUL byte

Buf#free SyncExperimental

buf.free();

Buf#grow AsyncExperimental

buf.grow(target_size).then(function(buf) {
  // Use buf
});

| Parameters | Type | | --- | --- | --- | | target_size | Number | The desired available size |

Returns
Buf The buffer to be resized; may or may not be allocated yet

Buf#isBinary SyncExperimental

var result = buf.isBinary();
Returns
Number 1 if buffer looks like non-text data

Buf#set AsyncExperimental

buf.set(data, datalen).then(function(buf) {
  // Use buf
});

| Parameters | Type | | --- | --- | --- | | data | Buffer | The data to copy into the buffer | | datalen | Number | The length of the data to copy into the buffer |

Returns
Buf The buffer to set

Instance Variables

Variable Type Description
asize Number
ptr String
size Number