Package com.wowza.wms.amf
Class AMFDataMixedArray
- Object
-
- com.wowza.wms.amf.AMFData
-
- com.wowza.wms.amf.AMFDataObj
-
- com.wowza.wms.amf.AMFDataMixedArray
-
- All Implemented Interfaces:
IAMFDataObj
public class AMFDataMixedArray extends AMFDataObj
AMFDataMixedArray: class for marshalling data between Wowza Pro server and Flash client. Array of mixed data types. An Array object created in the Flash client is wrapped in this data type when sent to the Wowza Pro server.
Create Array of Strings
AMFDataMixedArray amfDataMixedArray = new AMFDataMixedArray(); amfDataMixedArray.put("0", "item1"); amfDataMixedArray.put("1", "item2"); amfDataMixedArray.put("2", "item3");
Iterate Mixed Array
AMFDataMixedArray amfDataMixedArray; int len = amfDataMixedArray.size(); for(int i=0;i<len;i++) { String value = amfDataMixedArray.getString(i); int itemType = amfDataMixedArray.getType(i); WMSLoggerFactory.getLogger(null).debug("item: ["+i+":"+amfDataMixedArray.getKey(i)+"]="+value+" type:"+itemType); }
NOTE: A AMFDataMixedArray is exactly the same as a AMFDataObj except its type is DATA_TYPE_MIXED_ARRAY.
This objects acts like a Map and a List at the same time. As items are added by key the order and position of each object is recorded. Objects can be retrieved either by key or by index.
-
-
Field Summary
-
Fields inherited from class com.wowza.wms.amf.AMFDataObj
DECODE_OBJ_REF, DECODE_TRAITS, DECODE_TRAITS_EXT, DECODE_TRAITS_REF, DECODE_UNDEFINED, members, order, serializer, trait
-
Fields inherited from class com.wowza.wms.amf.AMFData
AMF_DEFAULT_DESERIALIZE_CHARSETNAME, AMF_LEVEL0, AMF_LEVEL3, DATA_TYPE_AMF3, DATA_TYPE_AMF3_ARRAY, DATA_TYPE_AMF3_BOOLEAN_FALSE, DATA_TYPE_AMF3_BOOLEAN_TRUE, DATA_TYPE_AMF3_BYTEARRAY, DATA_TYPE_AMF3_DATE, DATA_TYPE_AMF3_INTEGER, DATA_TYPE_AMF3_NULL, DATA_TYPE_AMF3_NUMBER, DATA_TYPE_AMF3_OBJECT, DATA_TYPE_AMF3_STRING, DATA_TYPE_AMF3_UNDEFINED, DATA_TYPE_AMF3_XML_LEGACY, DATA_TYPE_AMF3_XML_TOP, DATA_TYPE_ARRAY, DATA_TYPE_AS_OBJECT, DATA_TYPE_BOOLEAN, DATA_TYPE_BYTEARRAY, DATA_TYPE_CUSTOM_CLASS, DATA_TYPE_DATE, DATA_TYPE_INTEGER, DATA_TYPE_LONG_STRING, DATA_TYPE_MIXED_ARRAY, DATA_TYPE_MOVIE_CLIP, DATA_TYPE_NULL, DATA_TYPE_NUMBER, DATA_TYPE_OBJECT, DATA_TYPE_OBJECT_END, DATA_TYPE_RECORDSET, DATA_TYPE_REFERENCE_OBJECT, DATA_TYPE_STRING, DATA_TYPE_UNDEFINED, DATA_TYPE_UNKNOWN, DATA_TYPE_XML, DATA_TYPE_XML_TOP, MILLS_PER_HOUR, type
-
-
Constructor Summary
Constructors Constructor Description AMFDataMixedArray()
Create empty AMFDataMixedArray objectAMFDataMixedArray(byte[] data)
Deserialize entire data array and create AMFDataMixedArray objectAMFDataMixedArray(byte[] data, int offset, int size)
Deserialize data array starting at offest for size bytes and create AMFDataMixedArray objectAMFDataMixedArray(java.nio.ByteBuffer data)
Deserialize entire data array and create AMFDataMixedArray objectAMFDataMixedArray(java.nio.ByteBuffer data, AMFDataContextDeserialize context)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
deserialize(java.nio.ByteBuffer data)
Deserialize data in byte buffervoid
deserialize(java.nio.ByteBuffer data, AMFDataContextDeserialize context)
Deserialize data in byte buffervoid
serialize(java.io.DataOutputStream out)
Serialize object to output streamvoid
serialize(java.io.DataOutputStream out, int objectEncoding)
Serialize object to output streamvoid
serialize(java.io.DataOutputStream out, AMFDataContextSerialize context)
Serialize object to output streamString
toString()
Return object as formatted string-
Methods inherited from class com.wowza.wms.amf.AMFDataObj
containsKey, get, get, getBoolean, getBoolean, getByte, getByte, getClassName, getDate, getDate, getDouble, getDouble, getFloat, getFloat, getInt, getInt, getKey, getKeys, getLong, getLong, getObject, getObject, getSerializer, getShort, getShort, getString, getString, getTrait, getValue, put, put, put, put, put, put, put, remove, remove, serialize, serialize, serialize, setClassName, setSerializer, size
-
Methods inherited from class com.wowza.wms.amf.AMFData
createContextDeserialize, createContextDeserialize, createContextSerialize, createContextSerialize, deserializeInnerObject, getReference, getType, isAMF3Start, isArrayStart, isByteArrayStart, isMixedArrayStart, isObjEnd, isObjStart, peekByte, setType, skipByte, testNextByte, triggerAMF3Switch
-
-
-
-
Constructor Detail
-
AMFDataMixedArray
public AMFDataMixedArray()
Create empty AMFDataMixedArray object
-
AMFDataMixedArray
public AMFDataMixedArray(byte[] data)
Deserialize entire data array and create AMFDataMixedArray object- Parameters:
data
- binary data
-
AMFDataMixedArray
public AMFDataMixedArray(byte[] data, int offset, int size)
Deserialize data array starting at offest for size bytes and create AMFDataMixedArray object- Parameters:
data
- binary dataoffset
- starting offset into datasize
- size of data to deserialize
-
AMFDataMixedArray
public AMFDataMixedArray(java.nio.ByteBuffer data)
Deserialize entire data array and create AMFDataMixedArray object- Parameters:
data
- binary data
-
AMFDataMixedArray
public AMFDataMixedArray(java.nio.ByteBuffer data, AMFDataContextDeserialize context)
-
-
Method Detail
-
deserialize
public void deserialize(java.nio.ByteBuffer data)
Description copied from class:AMFData
Deserialize data in byte buffer- Overrides:
deserialize
in classAMFDataObj
- Parameters:
data
- binary data
-
deserialize
public void deserialize(java.nio.ByteBuffer data, AMFDataContextDeserialize context)
Description copied from class:AMFData
Deserialize data in byte buffer- Overrides:
deserialize
in classAMFDataObj
- Parameters:
data
- binary datacontext
- deserialization context used by AMF3
-
serialize
public void serialize(java.io.DataOutputStream out)
Description copied from class:AMFData
Serialize object to output stream- Overrides:
serialize
in classAMFDataObj
- Parameters:
out
- Output stream
-
serialize
public void serialize(java.io.DataOutputStream out, int objectEncoding)
Description copied from class:AMFData
Serialize object to output stream- Overrides:
serialize
in classAMFDataObj
- Parameters:
out
- Output streamobjectEncoding
- object encoding level (see AMF_LEVEL*)
-
serialize
public void serialize(java.io.DataOutputStream out, AMFDataContextSerialize context)
Description copied from class:AMFData
Serialize object to output stream- Overrides:
serialize
in classAMFDataObj
- Parameters:
out
- Output streamcontext
- serialization context used by AMF3
-
toString
public String toString()
Return object as formatted string- Overrides:
toString
in classAMFDataObj
-
-