Created
December 23, 2020 17:04
-
-
Save kmoskwiak/583622ab0d8005c78ed87988ed4d6e7b to your computer and use it in GitHub Desktop.
read with shared buffer
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function readBytes(fd, sharedBuffer) { | |
return new Promise((resolve, reject) => { | |
fs.read( | |
fd, | |
sharedBuffer, | |
0, | |
sharedBuffer.length, | |
null, | |
(err) => { | |
if(err) { return reject(err); } | |
resolve(); | |
} | |
); | |
}); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment