byteArrayToHexString

Converts a ByteArray into a hex string that is used by ssCore.FileSys.appendToFileBinary and ssCore.FileSys.writeToFileBinary.


Availability:

First available in version 3.5 build 314.

Available only in ActionScript 3.


Usage:

dataStr = StringUtils.byteArrayToHexString(dataByteArr)

dataStr - String - The ByteArray data represented as a hex string formatted as two characters per byte.


Parameters:

dataByteArr - ByteArray - A ByteArray that will be converted into a hex string.


Notes:

Editing binary values cannot be done directly in ActionScript, which is why there is the ByteArray class in ActionScript 3. With a ByteArray you can manipulate data at the byte level. Use this function to convert a ByteArray into data that can be written by ssCore.FileSys.appendToFileBinary and ssCore.FileSys.writeToFileBinary.

See ssCore.FileSys.appendToFileBinary, ssCore.FileSys.readFileBinary, ssCore.FileSys.writeToFileBinary, and StringUtils.hexStringToByteArray.


Examples:

var dataStr:String = StringUtils.byteArrayToHexString(myByteArray);

var r:Object = ssCore.FileSys.writeToFileBinary({path:"startdir://file.swf", data:dataStr});