Skip to content

Commit

Permalink
update readme, realized i made a mistake in copy()
Browse files Browse the repository at this point in the history
  • Loading branch information
heapwolf committed Mar 31, 2015
1 parent d80c1eb commit fe5d6d2
Showing 1 changed file with 31 additions and 1 deletion.
32 changes: 31 additions & 1 deletion README.md
@@ -1,4 +1,6 @@
# SYNOPSIS
A little sugar on top of `uv_buf_t`. This should get moved out to
another module called `nodeuv-buffer`.

# USAGE

Expand All @@ -19,8 +21,36 @@ Buffer buf(10);
# API

## CONSTRUCTOR
Various ways to construct a buffer.

### Buffer buf();
### Buffer buf(size);
### Buffer buf(string data);
### Buffer buf(char* data);

## INSTANCE METHODS

## STATIC METHODS
### `string` buf.toString();
Convert the buffer to a string.

### `int` buf.length();
The length of the buffer.

### `void` buf.copy(Buffer targetBuf[, int targetStart][, int sourceStart][, int sourceEnd]);
Copy a buffer into another one.

- `targetBuf` a buffer to copy from.
- `targetStart` an optional `int`, defaults to `0`.
- `sourceStart` an optional `int`, defaults to `0`.
- `sourceEnd` an optional `int`, defaults to the srouce buffer's length.

Copies data from a region of this buffer to a region in the target buffer
even if the target memory region overlaps with the source. If undefined
the targetStart and sourceStart parameters default to 0 while sourceEnd
defaults to the source buffer's `buffer.length`.

## INSTANCE MEMBERS

### buf.data
The current value of the buffer.

0 comments on commit fe5d6d2

Please sign in to comment.