O'Reilly logo

ActionScript 3.0 Bible by Roger Braunstein

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Chapter 13. Binary Data and ByteArrays

FEATURED CLASSES

  • flash.utils.ByteArray

  • flash.utils.IDataInput

  • flash.utils.IDataOutput

In ActionScript and other programming languages, you use a variety of data types to intelligently organize data. Breaking out of the walled garden of your own program and accessing data from the outside world can force you to change representations of the data, since not every system uses the same data types or encodes them in the same way. These conversions can be automatic and effortless, or they can require painful acrobatics and careful handling of edge cases. The ultimate common denominator in representations of data, of course, is binary: the long digital sequences of 0s and 1s that are sent about your computer hardware, and across wires and radio signals that connect your computer to the internet.

By supporting high-level data types like Vector and Dictionary, Flash Player gives you the opportunity to create algorithms that tackle problems with the appropriate tools or to build those tools when they aren't included (like an AVL tree, a doubly linked list, or a directed graph, for example). But by supporting raw binary data, Flash Player opens up the entire universe of data. Without byte-level access, you can interpret data only if it comes in a format that Flash Player understands. With byte-level access, you can interface with any computer or interpret any digitized data if you can write an interpreter for it in ActionScript.

It's the inclusion of binary ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required