On my server file system I have a directory which contains some .bin file filled with 16 bit integers.
How can I load a Uint16Array variable with the content of a specific .bin file in Node.js?
I already tried:
var arrayFromBinFile = new Uint16Array('./myDirectoryContainingBinFiles/selectedFile.bin')
By using console.log
in node.js all I get is:
{
BYTES_PER_ELEMENT: 2,
get: [Function: get],
set: [Function: set],
slice: [Function: slice],
subarray: [Function: subarray],
buffer: { slice: [Function: slice], byteLength: 0 },
length: 0,
byteOffset: 0,
byteLength: 0
}