mx.utils

# Base64Decoder - AS3 Flex

Package | mx.utils
Class | public class Base64Decoder
Inheritance | Base64Decoder Object

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

A utility class to decode a Base64 encoded String to a ByteArray.

Public Properties
Hide Inherited Public Properties
Show Inherited Public Properties

| Property | Defined By
--- | --- | ---
|  | constructor : Object A reference to the class object or constructor function for a given object instance. | Object

Public Methods
Hide Inherited Public Methods
Show Inherited Public Methods

| Method | Defined By
--- | --- | ---
|  | Base64Decoder() Constructor. | Base64Decoder
|  | decode(encoded:String):void Decodes a Base64 encoded String and adds the result to an internal buffer. | Base64Decoder
|  | hasOwnProperty(name:String):Boolean Indicates whether an object has a specified property defined. | Object
|  | isPrototypeOf(theClass:Object):Boolean Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter. | Object
|  | propertyIsEnumerable(name:String):Boolean Indicates whether the specified property exists and is enumerable. | Object
|  | reset():void Clears all buffers and resets the decoder to its initial state. | Base64Decoder
|  | setPropertyIsEnumerable(name:String, isEnum:Boolean = true):void Sets the availability of a dynamic property for loop operations. | Object
|  | toByteArray():ByteArray Returns the current buffer as a decoded flash.utils.ByteArray. | Base64Decoder
|  | toLocaleString():String Returns the string representation of this object, formatted according to locale-specific conventions. | Object
|  | toString():String Returns the string representation of the specified object. | Object
|  | valueOf():Object Returns the primitive value of the specified object. | Object

Constructor Detail

### Base64Decoder

()
Constructor

`public function Base64Decoder()`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Constructor.

Method Detail

### decode

()
method

`public function decode(encoded:String):void`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Decodes a Base64 encoded String and adds the result to an internal buffer. Strings must be in ASCII format.

Subsequent calls to this method add on to the internal buffer. After all data have been encoded, call `toByteArray()` to obtain a decoded `flash.utils.ByteArray`.

Parameters

| `encoded:String` — The Base64 encoded String to decode.

### reset

()
method

`public function reset():void`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Clears all buffers and resets the decoder to its initial state.

### toByteArray

()
method

`public function toByteArray():ByteArray`

Language Version: | ActionScript 3.0

Product Version: | Flex 3

Runtime Versions: | Flash Player 9, AIR 1.1

Returns the current buffer as a decoded `flash.utils.ByteArray`. Note that calling this method also clears the buffer and resets the decoder to its initial state.

Returns

| `ByteArray` — The decoded `flash.utils.ByteArray`.

© 2015 Adobe Systems Incorporated. All rights reserved.
Mon Apr 10 2017, 12:28 PM -07:00