<!-- Generated by documentation.js. Update this documentation by updating the source code. -->

### Table of Contents

-   [constructor](#constructor)
-   [read](#read)
-   [write](#write)
-   [end](#end)
-   [bytesRead](#bytesread)
-   [bytesWrote](#byteswrote)

## constructor

[index.js:8-12](https://github.com/wanderer/buffer-pipe/blob/9aa3e2f794fab45e36fada634829fdb4260dcdea/index.js#L8-L12 "Source code on GitHub")

Creates a new instance of a pipe

**Parameters**

-   `buf` **[Buffer](https://nodejs.org/api/buffer.html)** an optional buffer to start with (optional, default `Buffer.from([])`)

## read

[index.js:19-24](https://github.com/wanderer/buffer-pipe/blob/9aa3e2f794fab45e36fada634829fdb4260dcdea/index.js#L19-L24 "Source code on GitHub")

read `num` number of bytes from the pipe

**Parameters**

-   `num` **[Number](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Number)** 

Returns **[Buffer](https://nodejs.org/api/buffer.html)** 

## write

[index.js:30-34](https://github.com/wanderer/buffer-pipe/blob/9aa3e2f794fab45e36fada634829fdb4260dcdea/index.js#L30-L34 "Source code on GitHub")

Wites a buffer to the pipe

**Parameters**

-   `buf` **[Buffer](https://nodejs.org/api/buffer.html)** 

## end

[index.js:40-42](https://github.com/wanderer/buffer-pipe/blob/9aa3e2f794fab45e36fada634829fdb4260dcdea/index.js#L40-L42 "Source code on GitHub")

Whether or not there is more data to read from the buffer
returns {Boolean}

## bytesRead

[index.js:48-50](https://github.com/wanderer/buffer-pipe/blob/9aa3e2f794fab45e36fada634829fdb4260dcdea/index.js#L48-L50 "Source code on GitHub")

returns the number of bytes read from the stream

Returns **Integer** 

## bytesWrote

[index.js:56-58](https://github.com/wanderer/buffer-pipe/blob/9aa3e2f794fab45e36fada634829fdb4260dcdea/index.js#L56-L58 "Source code on GitHub")

returns the number of bytes wrote to the stream

Returns **Integer** 
