Titanium.Codec

Submodule of Titanium.
Platform Since
Android 1.7
iPhone 1.7
iPad 1.7

Summary

A module for converting Numbers and Strings to and from a Titanium.Buffer.

Methods

Name Summary
addEventListener

Adds the specified callback as an event listener for the named event.

decodeNumber

Decodes the source buffer (starting at the optional position) using the passed in data type. Throws an Exception if source is null, or position is greater than source.length

decodeString

Decodes the source buffer into a String starting at position, with length bytes, using the supplied character set charset. Throws an Exception if charset is not a valid character set, source is null, or either position, length, or position+length is greater than source.length.

encodeNumber

Encodes the Number source into dest using the passed in data type.

encodeString

Encodes the String source into dest using charset. Throws an Exception if charset is not a valid character set, source is null, or either sourcePosition, sourceLength, or sourcePosition+sourceLength is greater than source.length.

fireEvent

Fires a synthesized event to any registered listeners.

getNativeByteOrder

Get the OS native byte order (either Titanium.Codec.BIG_ENDIAN or Titanium.Codec.LITTLE_ENDIAN)

removeEventListener

Removes the specified callback as an event listener for the named event.

Properties

Name Type Summary
BIG_ENDIAN Number

Big Endian (network) byte order, i.e. most significant byte first. read-only

CHARSET_ASCII String

The ASCII Character Set read-only

CHARSET_ISO_LATIN_1 String

The ISO 8859-1 (LATIN-1) Character Set read-only

CHARSET_UTF16 String

The UTF-16 Character Set read-only

CHARSET_UTF16BE String

The UTF-16 Character Set with Big Endian byte order read-only

CHARSET_UTF16LE String

The UTF-16 Character Set with Little Endian byte order read-only

CHARSET_UTF8 String

The UTF-8 Character Set read-only

LITTLE_ENDIAN Number

Little Endian byte order, i.e. least significant byte first. read-only

TYPE_BYTE String

8 bit integer encoding type read-only

TYPE_DOUBLE String

64 bit double precision floating-point type read-only

TYPE_FLOAT String

32 bit single precision floating-point type read-only

TYPE_INT String

32 bit integer encoding type read-only

TYPE_LONG String

64 bit integer encoding type read-only

TYPE_SHORT String

16 bit integer encoding type read-only

Events

This type has no events.