diff options
Diffstat (limited to 'src/node_buffer.h')
-rw-r--r-- | src/node_buffer.h | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/node_buffer.h b/src/node_buffer.h index 122afc3770..11010017ce 100644 --- a/src/node_buffer.h +++ b/src/node_buffer.h @@ -65,6 +65,12 @@ NODE_EXTERN v8::MaybeLocal<v8::Object> New(v8::Isolate* isolate, char* data, size_t len); +// Creates a Buffer instance over an existing ArrayBuffer. +NODE_EXTERN v8::MaybeLocal<v8::Uint8Array> New(v8::Isolate* isolate, + v8::Local<v8::ArrayBuffer> ab, + size_t byte_offset, + size_t length); + // This is verbose to be explicit with inline commenting static inline bool IsWithinBounds(size_t off, size_t len, size_t max) { // Asking to seek too far into the buffer |