Simple text file
Closed this issue · 4 comments
avpdiver commented
How can I load simple text file with unknown length?
RReverser commented
Why do you need binary data library for text file? Why not just use AJAX / Node.js API for that?
avpdiver commented
Its webgl 3d engine and i have wrote one general resource loader for textures, meshes, shaders and etc. Shader are text file.
RReverser commented
The best would be still to load them with regular AJAX.
However, if you still want to use jBinary's loader and parser, you can do something like:
jBinary.load(source).then(function (binary) {
var text = binary.read('string' /* , 'utf-8' */);
// do whatever you want with retrieved text
});
avpdiver commented
Thanks.