# Buffer
> [Buffer][node-buffer] constructor.
## Usage
```javascript
var Buffer = require( '@stdlib/buffer/ctor' );
```
#### Buffer( size )
Allocates a [`Buffer`][node-buffer] having a specified number of bytes.
```javascript
var b = new Buffer( 10 );
// returns
```
#### Buffer( array )
Allocates a [`Buffer`][node-buffer] from an array of octets.
```javascript
var b = new Buffer( [ 1, 2, 3, 4 ] );
// returns [ 1, 2, 3, 4 ]
```
#### Buffer( buffer )
Copies [buffer][node-buffer] data to a new [`Buffer`][node-buffer] instance.
```javascript
var b1 = new Buffer( [ 1, 2, 3, 4 ] );
var b2 = new Buffer( b1 );
// returns [ 1, 2, 3, 4 ]
```
#### Buffer( str\[, encoding] )
Returns a [`Buffer`][node-buffer] containing a provided `string`.
```javascript
var b = new Buffer( 'beep boop' );
// returns
```
* * *
### Properties
TODO: add properties
* * *
### Methods
TODO: add methods
* * *
## Examples
```javascript
var ctor = require( '@stdlib/buffer/ctor' );
var b;
var i;
// Allocate uninitialized memory:
if ( typeof ctor.alloc === 'function' ) {
b = ctor.alloc( 10 );
} else {
b = new ctor( 10 );
}
// Zero fill the buffer...
for ( i = 0; i < b.length; i++ ) {
b[ i ] = 0;
}
console.log( b );
```
[node-buffer]: https://nodejs.org/api/buffer.html