Pacotemx.utils
Classepublic class Base64Encoder
HerançaBase64Encoder Inheritance Object

A utility class to encode a String or ByteArray as a Base64 encoded String.



Propriedades Públicas
 PropriedadeDefinido por
 Inheritedconstructor : Object
A reference to the class object or constructor function for a given object instance.
Object
  insertNewLines : Boolean = true
A Boolean flag to control whether the sequence of characters specified for Base64Encoder.newLine are inserted every 76 characters to wrap the encoded output.
Base64Encoder
  newLine : int = 10
[static] The character codepoint to be inserted into the encoded output to denote a new line if insertNewLines is true.
Base64Encoder
 Inheritedprototype : Object
[static] A reference to the prototype object of a class or function object.
Object
Métodos Públicos
 MétodoDefinido por
  
Constructor.
Base64Encoder
  
encode(data:String, offset:uint = 0, length:uint = 0):void
Encodes the characters of a String in Base64 and adds the result to an internal buffer.
Base64Encoder
  
encodeBytes(data:ByteArray, offset:uint = 0, length:uint = 0):void
Encodes a ByteArray in Base64 and adds the result to an internal buffer.
Base64Encoder
  
Encodes the UTF-8 bytes of a String in Base64 and adds the result to an internal buffer.
Base64Encoder
 Inherited
Indicates whether an object has a specified property defined.
Object
 Inherited
Indicates whether an instance of the Object class is in the prototype chain of the object specified as the parameter.
Object
 Inherited
Indicates whether the specified property exists and is enumerable.
Object
  
Clears all buffers and resets the encoder to its initial state.
Base64Encoder
 Inherited
Sets the availability of a dynamic property for loop operations.
Object
  
Returns the current buffer as a Base64 encoded String.
Base64Encoder
 Inherited
Returns the primitive value of the specified object.
Object
Constantes públicas
 ConstanteDefinido por
  CHARSET_UTF_8 : String = "UTF-8"
[static]
Base64Encoder
Detalhes da propriedade
insertNewLinespropriedade
public var insertNewLines:Boolean = true

A Boolean flag to control whether the sequence of characters specified for Base64Encoder.newLine are inserted every 76 characters to wrap the encoded output. The default is true.

newLinepropriedade 
public static var newLine:int = 10

The character codepoint to be inserted into the encoded output to denote a new line if insertNewLines is true. The default is 10 to represent the line feed \n.

Detalhes do construtor
Base64Encoder()Construtor
public function Base64Encoder()

Constructor.

Detalhes do método
encode()método
public function encode(data:String, offset:uint = 0, length:uint = 0):void

Encodes the characters of a String in Base64 and adds the result to an internal buffer. Subsequent calls to this method add on to the internal buffer. After all data have been encoded, call toString() to obtain a Base64 encoded String.

Parâmetros

data:String — The String to encode.
 
offset:uint (default = 0) — The character position from which to start encoding.
 
length:uint (default = 0) — The number of characters to encode from the offset.

encodeBytes()método 
public function encodeBytes(data:ByteArray, offset:uint = 0, length:uint = 0):void

Encodes a ByteArray in Base64 and adds the result to an internal buffer. Subsequent calls to this method add on to the internal buffer. After all data have been encoded, call toString() to obtain a Base64 encoded String.

Parâmetros

data:ByteArray — The ByteArray to encode.
 
offset:uint (default = 0) — The index from which to start encoding.
 
length:uint (default = 0) — The number of bytes to encode from the offset.

encodeUTFBytes()método 
public function encodeUTFBytes(data:String):void

Encodes the UTF-8 bytes of a String in Base64 and adds the result to an internal buffer. The UTF-8 information does not contain a length prefix. Subsequent calls to this method add on to the internal buffer. After all data have been encoded, call toString() to obtain a Base64 encoded String.

Parâmetros

data:String — The String to encode.

reset()método 
public function reset():void

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

toString()método 
public function toString():String

Returns the current buffer as a Base64 encoded String. Note that calling this method also clears the buffer and resets the encoder to its initial state.

Retorna
String — The Base64 encoded String.
Detalhes da constante
CHARSET_UTF_8Constante
public static const CHARSET_UTF_8:String = "UTF-8"