0.1.0 • Published 8 years ago
pivot-buffer v0.1.0
pivot-buffer
Rotating data buffer for Node.js
Kind: global class
- PivotBuffer
- new PivotBuffer(size)
- .value ⇒ Buffer
- .length ⇒ number
- .append(buffer)
new PivotBuffer(size)
Param | Type | Description |
---|---|---|
size | number | The fixed size of the buffer, beyond which point data will be rotated. |
pivotBuffer.value ⇒ Buffer
The underlying buffer. Truncated to size of current data (may be smaller than size specified in constructor).
Kind: instance property of PivotBuffer
pivotBuffer.length ⇒ number
Length of current buffer, between the range of 0 to buffer size, inclusive.
Kind: instance property of PivotBuffer
pivotBuffer.append(buffer)
Append a node buffer to the current buffer, rotating the current data if necessary. If buffer to append is bigger than the cap of the pivot buffer, only the last portion of it will be written.
Kind: instance method of PivotBuffer
Param | Type | Description |
---|---|---|
buffer | Buffer | the buffer to append |