PicoCreator
PicoCreator

Reputation: 10154

AS3 Number, Int to Bytes/Char

Is there a code base that would allow the conversion of most common number types to be converted to byte/char. Im looking for a simple conversion using any codebase, or as3 default code base. Not the int to byte formulae.

The idea is to convert large numbers into char bytes, so as to save space for string transmission of data over the net. As oppose to converting every digit to a string character.

The shorter the as3 code is to implement, the better.

Upvotes: 2

Views: 3216

Answers (1)

divillysausages
divillysausages

Reputation: 8033

The ByteArray class: http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/utils/ByteArray.html has methods for reading/writing ints, floats, doubles etc. Is that what you're looking for?

Upvotes: 4

Related Questions