From 71e244ba99788ec2362c79b35f4eaf1240347fd3 Mon Sep 17 00:00:00 2001 From: Fabian Wiles Date: Fri, 3 Aug 2018 12:02:33 +1200 Subject: [PATCH] provide a way to find the bytes read from Buffer --- lib/binary_parser.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/binary_parser.js b/lib/binary_parser.js index 12ece7ee..9f829a6e 100644 --- a/lib/binary_parser.js +++ b/lib/binary_parser.js @@ -285,7 +285,7 @@ Parser.prototype.addRawCode = function(ctx) { this.resolveReferences(ctx); - ctx.pushCode("return vars;"); + ctx.pushCode("vars.__bytesRead = offset; return vars;"); }; Parser.prototype.addAliasedCode = function(ctx) {