forked from ably/xdelta-async-nodejs-addon
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathXdeltaDecodeAsyncWorker.cc
29 lines (24 loc) · 1.08 KB
/
XdeltaDecodeAsyncWorker.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
#include <napi.h>
#include <xdelta3.h>
#include <XdeltaDecodeAsyncWorker.h>
using namespace Napi;
XdeltaDecodeAsyncWorker::XdeltaDecodeAsyncWorker(Buffer<uint8_t> &dictionary,
Buffer<uint8_t> &delta,
Buffer<uint8_t> &result,
Function& callback) : BaseXdeltaAsyncWorker(dictionary,
delta,
result,
callback)
{
}
void XdeltaDecodeAsyncWorker::Execute()
{
res = xd3_decode_memory(inputPtr,
inputLength,
dictionaryPtr,
dictionaryLength,
resultPtr,
&bytesWritten,
resultLength,
0);
}