MDN’s new design is in Beta! A sneak peek:

Binary strings

Tento překlad není kompletní. Prosím pomozte přeložit tento článek z angličtiny.

As web applications become more and more powerful, adding features such as audio and video manipulation, access to raw data using WebSockets, and so forth, it has become clear that there are times when it would be helpful for JavaScript code to be able to quickly and easily manipulate raw binary data. In the past, this had to be simulated by treating the raw data as a string and using the charCodeAt() method to read the bytes from the data buffer.

However, this is slow and error-prone, due to the need for multiple conversions (especially if the binary data is not actually byte-format data, but, for example, 32-bit integers or floats).

JavaScript typed arrays provide a mechanism for accessing raw binary data much more efficiently. The StringView Non native constructor is one level above typed arrays and provides a C-like interface for strings.

See also

Štítky a přispěvatelé do dokumentace

 Přispěvatelé této stránky: astrie2
 Poslední aktualizace od: astrie2,