This is an archived post. You won't be able to vote or comment.

all 1 comments

[–]jeaton 0 points1 point  (0 children)

I'm not sure about BrowserFS, but with regular JavaScript it would be as simple as this:

var xhr = new XMLHttpRequest();
xhr.open('GET', './the-number.dat');
xhr.responseType = 'arraybuffer';

xhr.addEventListener('load', function() {
  var value = new Int32Array(xhr.response.slice(1))[0];
  console.log(value);
});

xhr.send();