blob: b1e11104f2153533f6b47b144bd38dae78d189f4 [file] [log] [blame]
{ "type": "class",
"qname": "org.apache.royale.utils.BinaryData",
"baseClassname": ""
,
"description": "The BinaryData class is a class that represents binary data. The way browsers handle binary data varies. This class abstracts those differences..",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"members": [
{ "type": "method",
"qname": "org.apache.royale.utils.BinaryData",
"namespace": "",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Constructor. The constructor takes an optional bytes argument. In Flash this should be a ByteArray. In JS this should be an ArrayBuffer",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "",
"params": [{ "name": "bytes", "type": "Object"}]}
,
{ "type": "method",
"qname": "fromString",
"namespace": "public",
"bindable": [],
"details": ["static"],
"deprecated": {},
"description": "Utility method to create a BinaryData object from a string.",
"tags": [
{ "tagName": "param",
"values": ["{String} str The string to convert to BinaryData as UTF-8 bytes."]},
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.7.0"]},
{ "tagName": "return",
"values": ["{BinaryData} The BinaryData instance from the UTF-8 bytes of the string. *"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "org.apache.royale.utils.BinaryData",
"params": [{ "name": "str", "type": "String"}]}
,
{ "type": "accessor",
"access": "read-only",
"return": "flash.utils.ByteArray",
"qname": "array",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Gets a reference to the internal array of bytes. On the Flash side, this is a ByteArray. On the JS side, it's a Uint8Array. This is primarily used for indexed access to the bytes, and particularly where platform-specific performance optimization is required. To maintain cross-target consistency, you should not alter the length of the ByteArray in any swf specific code, you should assume its length is fixed (even though it is not).",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.7.0"]},
{ "tagName": "return",
"values": ["{ByteArray} The BinaryData backing array as ByteArray on flash."]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "String",
"qname": "endian",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Indicates the byte order for the data. The default is Endian BIG_ENDIAN. It is possible to check the default system Endianness of the target platform at runtime with <code>org.apache.royale.utils.Endian.systemEndian</code>. Setting to values other than Endian.BIG_ENDIAN or Endian.LITTLE_ENDIAN is ignored.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.7.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "field",
"qname": "ba",
"return": "flash.utils.ByteArray",
"namespace": "protected",
"bindable": [],
"details": [],
"deprecated": {}},
{ "type": "accessor",
"access": "read-only",
"return": "Object",
"qname": "data",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Get the platform-specific data for sending. Generally only used by the network services.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "method",
"qname": "toString",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "create a string representation of the binary data",
"return": "String",
"params": []}
,
{ "type": "method",
"qname": "writeBoolean",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Write a Boolean value (as a single byte) at the current position",
"tags": [
{ "tagName": "param",
"values": ["{Boolean} value The boolean value to write into the BinaryData at the current position"]},
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "void",
"params": [{ "name": "value", "type": "Boolean"}]}
,
{ "type": "method",
"qname": "writeByte",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Write a byte of binary data at the current position",
"tags": [
{ "tagName": "param",
"values": ["{int} byte The value to write into the BinaryData at the current position"]},
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "void",
"params": [{ "name": "byte", "type": "int"}]}
,
{ "type": "method",
"qname": "writeBinaryData",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Writes a sequence of <code>length</code> bytes from the <code>source</code> BinaryData, starting at <code>offset</code> (zero-based index) bytes into the source BinaryData. If length is omitted or is zero, it will represent the entire length of the source starting from offset. If offset is omitted also, it defaults to zero.",
"tags": [
{ "tagName": "param",
"values": ["{BinaryData} source The source BinaryData to write from at the current position", "{uint} offset The optional offset value of the starting bytes to write inside source", "{uint} length The optional length value of the bytes to write from offset in source"]},
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "royaleignorecoercion",
"values": ["ArrayBuffer"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "void",
"params": [{ "name": "bytes", "type": "org.apache.royale.utils.BinaryData"},
{ "name": "offset", "type": "uint"},
{ "name": "length", "type": "uint"}]}
,
{ "type": "method",
"qname": "writeBytes",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"return": "void",
"params": [{ "name": "bytes", "type": "flash.utils.ByteArray"},
{ "name": "offset", "type": "uint"},
{ "name": "length", "type": "uint"}]}
,
{ "type": "method",
"qname": "writeShort",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Write a short integer (16 bits, typically represented by a 32 bit int parameter between -32768 and 65535) of binary data at the current position",
"tags": [
{ "tagName": "param",
"values": ["{int} short The value to write into the BinaryData at the current position"]},
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "void",
"params": [{ "name": "short", "type": "int"}]}
,
{ "type": "method",
"qname": "writeUnsignedInt",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Write an unsigned int (32 bits) of binary data at the current position",
"tags": [
{ "tagName": "param",
"values": ["{uint} val The value to write into the BinaryData at the current position"]},
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "void",
"params": [{ "name": "val", "type": "uint"}]}
,
{ "type": "method",
"qname": "writeInt",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Write a signed int (32 bits) of binary data at the current position",
"tags": [
{ "tagName": "param",
"values": ["{int} val The value to write into the BinaryData at the current position"]},
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "void",
"params": [{ "name": "val", "type": "int"}]}
,
{ "type": "method",
"qname": "writeFloat",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Writes an IEEE 754 single-precision (32-bit) floating-point number to the BinaryData at the current position",
"tags": [
{ "tagName": "param",
"values": ["{Number} val The value to write into the BinaryData at the current position"]},
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "void",
"params": [{ "name": "val", "type": "Number"}]}
,
{ "type": "method",
"qname": "writeDouble",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Writes an IEEE 754 double-precision (64-bit) floating-point number to the BinaryData at the current position",
"tags": [
{ "tagName": "param",
"values": ["{Number} val The value to write into the BinaryData at the current position"]},
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "void",
"params": [{ "name": "val", "type": "Number"}]}
,
{ "type": "method",
"qname": "readBoolean",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Reads a Boolean value (as a single byte) at the current position. returns true if the byte was non-zero, false otherwise",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "return",
"values": ["{Boolean} The boolean value read from the current position"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "Boolean",
"params": []}
,
{ "type": "method",
"qname": "readByte",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Read a signed byte of binary data at the current position",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "return",
"values": ["{int} An int value in the range -128 to 127, read from the current position"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "int",
"params": []}
,
{ "type": "method",
"qname": "readUnsignedByte",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Read an unsigned byte of binary data at the current position",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "return",
"values": ["{uint} An uint value in the range 0 to 255, read from the current position"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "uint",
"params": []}
,
{ "type": "method",
"qname": "readBinaryData",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Reads the number of data bytes, specified by the length parameter, from the BinaryData. The bytes are read into the BinaryData object specified by the destination parameter, and the bytes are written into the destination BinaryData starting at the position specified by offset. If length is omitted or is zero, all bytes are read following the current position to the end of this BinaryData. If offset is also omitted, it defaults to zero.",
"tags": [
{ "tagName": "param",
"values": ["{BinaryData} bytes The destination BinaryData to write bytes into from the current position", "{uint} offset The optional offset value of the starting bytes to write inside destination", "{uint} length The optional length value of the bytes to read"]},
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "void",
"params": [{ "name": "bytes", "type": "org.apache.royale.utils.BinaryData"},
{ "name": "offset", "type": "uint"},
{ "name": "length", "type": "uint"}]}
,
{ "type": "method",
"qname": "readBytes",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"return": "void",
"params": [{ "name": "bytes", "type": "flash.utils.ByteArray"},
{ "name": "offset", "type": "uint"},
{ "name": "length", "type": "uint"}]}
,
{ "type": "method",
"qname": "readByteAt",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Read a byte of binary data at the specified index. Does not change the <code>position</code> property. If an index is out of range (beyond the current length) this will return zero.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "return",
"values": ["{uint} A byte value in the range 0-255 from the index"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "uint",
"params": [{ "name": "idx", "type": "uint"}]}
,
{ "type": "method",
"qname": "writeByteAt",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Writes a byte of binary data at the specified index. Does not change the <code>position</code> property. This is a method for optimzed writes with no range checking. If the specified index is out of range, it can throw an error.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "void",
"params": [{ "name": "idx", "type": "uint"},
{ "name": "byte", "type": "int"}]}
,
{ "type": "method",
"qname": "readShort",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Read a short int of binary data at the current position",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "return",
"values": ["{int} An int value in the range -32768 to 32767, read from the current position"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "int",
"params": []}
,
{ "type": "method",
"qname": "readUnsignedInt",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Read an unsigned int (32bit) of binary data at the current position",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "return",
"values": ["{uint} A uint value, read from the current position"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "uint",
"params": []}
,
{ "type": "method",
"qname": "readUnsignedShort",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Read an unsigned short (16bit) of binary data at the current position",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "return",
"values": ["{uint} A uint value in the range 0 to 65535, read from the current position"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "uint",
"params": []}
,
{ "type": "method",
"qname": "readInt",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Read a signed int (32bit) of binary data at the current position",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "return",
"values": ["{int} An int value, read from the current position"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "int",
"params": []}
,
{ "type": "method",
"qname": "readFloat",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Reads an IEEE 754 single-precision (32-bit) floating-point number from the BinaryData.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "return",
"values": ["{Number} A Number value, read from the current position"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "Number",
"params": []}
,
{ "type": "method",
"qname": "readDouble",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Reads an IEEE 754 double-precision (64-bit) floating-point number from the BinaryData.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "return",
"values": ["{Number} A Number value, read from the current position"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "Number",
"params": []}
,
{ "type": "accessor",
"access": "read-write",
"return": "int",
"qname": "length",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "The length of this BinaryData, in bytes. If the length is set to a value that is larger than the current length, the right side of the BinaryData is filled with zeros. If the length is set to a value that is smaller than the current length, the BinaryData is truncated.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.7.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-only",
"return": "uint",
"qname": "bytesAvailable",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "The total number of bytes available to read from the current position.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "accessor",
"access": "read-write",
"return": "uint",
"qname": "position",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Moves, or returns the current position, in bytes, of the pointer into the BinaryData object. This is the point at which the next call to a read method starts reading or a write method starts writing. Setting the position beyond the end of the current length value is possible and will increase the length during write operations, but will throw an error during read operations.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ]},
{ "type": "method",
"qname": "growBuffer",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "A convenience method to extend the length of the BinaryData so you can efficiently write more bytes to it. Not all browsers have a way to auto-resize a binary data as you write data to the binary data buffer and resizing in large chunks is generally more efficient anyway. Preallocating bytes to write into is also more efficient on the swf target.",
"tags": [
{ "tagName": "param",
"values": ["extra The number of additional bytes."]},
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "void",
"params": [{ "name": "extra", "type": "uint"}]}
,
{ "type": "method",
"qname": "readUTF",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Reads a UTF-8 string from the BinaryData. The string is assumed to be prefixed with an unsigned short indicating the length in bytes. The <code>position</code> is advanced to the first byte following the string's bytes.",
"tags": [
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.7.0"]},
{ "tagName": "return",
"values": ["{String} The utf-8 decoded string"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "String",
"params": []}
,
{ "type": "method",
"qname": "readUTFBytes",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Reads a sequence of UTF-8 bytes specified by the length parameter from the BinaryData and returns a string. The <code>position</code> is advanced to the first byte following the string's bytes.",
"tags": [
{ "tagName": "param",
"values": ["{uint} length An unsigned integer indicating the length of the UTF-8 bytes."]},
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.7.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "String",
"params": [{ "name": "length", "type": "uint"}]}
,
{ "type": "method",
"qname": "writeUTF",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Writes a UTF-8 string to the byte stream. The length of the UTF-8 string in bytes is written first, as a 16-bit unsigned integer, followed by the bytes representing the characters of the string. If the byte length of the string is larger than 65535 this will throw a RangeError The <code>position</code> is advanced to the first byte following the string's bytes.",
"tags": [
{ "tagName": "param",
"values": ["{String} str The string value to be written."]},
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.7.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "void",
"params": [{ "name": "str", "type": "String"}]}
,
{ "type": "method",
"qname": "writeUTFBytes",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"description": "Writes a UTF-8 string to the BinaryData. Similar to the writeUTF() method, but writeUTFBytes() does not prefix the string with a 16-bit length word, and therefore also permits strings longer than 65535 bytes (note: byte length will not necessarily be the same as string length because some characters can be multibyte characters).",
"tags": [
{ "tagName": "param",
"values": ["{String} str The string value to be written."]},
{ "tagName": "playerversion",
"values": ["Flash 10.2", "AIR 2.6"]},
{ "tagName": "productversion",
"values": ["Royale 0.7.0"]},
{ "tagName": "langversion",
"values": ["3.0"]} ],
"return": "void",
"params": [{ "name": "str", "type": "String"}]}
,
{ "type": "method",
"qname": "readMultiByte",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"return": "String",
"params": [{ "name": "length", "type": "uint"},
{ "name": "charSet", "type": "String"}]}
,
{ "type": "method",
"qname": "writeMultiByte",
"namespace": "public",
"bindable": [],
"details": [],
"deprecated": {},
"return": "void",
"params": [{ "name": "value", "type": "String"},
{ "name": "charSet", "type": "String"}]}
]
}