From 74fea90f562f03aa68a9eacb63ac1be977daad3e Mon Sep 17 00:00:00 2001 From: Matthias Ohlemeyer Date: Thu, 17 Apr 2014 08:42:01 +0200 Subject: [PATCH] Add method to retrieve the buffer as a byte array --- src/main/resources/vertx/buffer.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/main/resources/vertx/buffer.js b/src/main/resources/vertx/buffer.js index 98f98ce..580fdfc 100644 --- a/src/main/resources/vertx/buffer.js +++ b/src/main/resources/vertx/buffer.js @@ -84,6 +84,15 @@ var Buffer = function(obj) { return __jbuf.getByte(pos); }; + /** + * Get a copy of the buffer as a byte array. + * + * @returns {array} + */ + this.getBytes = function() { + return __jbuf.getBytes(); + }; + /** * Get a signed 32 bit integer from the buffer. *