I want to design and write a 3d image viewing web application in JavaScript. I've already written it in java and flash and basically want to port it. I want the 3d image export files to be in a binary format just like the Java and flash versions I've written however, I'm unsure if JavaScript can handle data in binary format efficiently. Can JavaScript handle binary data quickly? How good/bad is it at handling compared with Java and Flash?
Asked
Active
Viewed 9,824 times
2 Answers
5
JavaScript can handle binary data via typed arrays. And here is a library for dealing with binary files, that you can use as a reference point for your application.
How quick is JavaScript - I'm not sure that this is the right question. It depends on browser, and user`s machine.
4
As @Bakudan said, you can use the TypedArray
s.
Most modern browsers support the DataView
API, which provides you random access to ArrayBuffer
s.
As addition, you can use BlobReader
to process blobs.
The whole process of parsing binary protocols (Blobs, ArrayBuffers, DataViews, TypedArrays, Binary Data over WebSockets) is described in this blog post.

Minko Gechev
- 25,304
- 9
- 61
- 68
-
1It's worth noting the jDataView/jBinary polyfill/extension of the DataView standard. – Brian M. Hunt Nov 19 '16 at 15:27