Comparing version 0.0.6 to 0.0.7
0.0.7 / 2012-05-09 | ||
================== | ||
- added the `reinterpret()` function | ||
0.0.6 / 2012-05-09 | ||
@@ -3,0 +8,0 @@ ================== |
@@ -244,3 +244,10 @@ | ||
exports._reinterpret = exports.reinterpret | ||
exports.reinterpret = function reinterpret (buffer, size) { | ||
var rtn = exports._reinterpret(buffer, size) | ||
exports._attach(rtn, buffer) | ||
return rtn | ||
} | ||
/** | ||
@@ -473,2 +480,6 @@ * Types. | ||
Buffer.prototype.reinterpret = function reinterpret (size) { | ||
return exports.reinterpret(this, size) | ||
} | ||
/** | ||
@@ -488,2 +499,3 @@ * SlowBuffer convenience methods. | ||
SlowBuffer.prototype.writeCString = Buffer.prototype.writeCString | ||
SlowBuffer.prototype.reinterpret = Buffer.prototype.reinterpret | ||
SlowBuffer.prototype['readInt64' + exports.endianness] = Buffer.prototype['readInt64' + exports.endianness] | ||
@@ -490,0 +502,0 @@ SlowBuffer.prototype['writeInt64' + exports.endianness] = Buffer.prototype['writeInt64' + exports.endianness] |
@@ -19,3 +19,3 @@ { "name": "ref" | ||
] | ||
, "version": "0.0.6" | ||
, "version": "0.0.7" | ||
, "author": "Nathan Rajlich <nathan@tootallnate.net> (http://tootallnate.net)" | ||
@@ -22,0 +22,0 @@ , "repository": { "type": "git", "url": "git://github.com/TooTallNate/ref.git" } |
@@ -160,3 +160,10 @@ ref | ||
#### `Buffer#reinterpret(Number size)` → Buffer | ||
Returns a new Buffer instance with the exact same memory address as the target | ||
buffer, only you can specifiy the size of the returned buffer as well. | ||
__Warning:__ This function is potentially _dangerous_! Be sure you need to use it! | ||
The "type" interface | ||
@@ -163,0 +170,0 @@ -------------------- |
Sorry, the diff of this file is not supported yet
54549
17
724
246