-
-
Save koyanloshe/f13b07d14ab5e9a11ea4447cb97be495 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