Package com.wowza.wms.amf
Class AMFDataItem
- Object
- 
- com.wowza.wms.amf.AMFData
- 
- com.wowza.wms.amf.AMFDataItem
 
 
- 
 public class AMFDataItem extends AMFData AMFDataItem: class for marshalling data between Wowza Pro server and Flash client. The type wraps native Java data types. - DATA_TYPE_NUMBER = int, long, short, double, float
- DATA_TYPE_STRING = String
- DATA_TYPE_BOOLEAN = boolean
- DATA_TYPE_DATE = Date
- DATA_TYPE_NULL = 'null'
 Create Native Java TypesAMFDataItem amfDataString = new AMFDataItem("here is my string"); // String AMFDataItem amfDataLong = new AMFDataItem(1234L); // long AMFDataItem amfDataDouble = new AMFDataItem(1.234); // double AMFDataItem amfDataBoolean = new AMFDataItem(true); // boolean AMFDataItem amfDataNull = new AMFDataItem(); // nullGet Native Java TypesString dataString = amfDataString.getType()==AMFData.DATA_TYPE_LONG_STRING? amfDataString.toString():""; long dataLong = amfDataLong.getType()==AMFData.DATA_TYPE_NUMBER? amfDataLong.longValue():0; double dataDouble = amfDataDouble.getType()==AMFData.DATA_TYPE_NUMBER? amfDataLong.doubleValue():0.0; boolean dataBoolean = amfDataBoolean.getType()==AMFData.DATA_TYPE_BOOLEAN? amfDataLong.booleanValue():false; Object dataNull = amfDataNull.getType()==AMFData.DATA_TYPE_NULL? null:null;
- 
- 
Field SummaryFields Modifier and Type Field Description static StringDATEFORMATprotected org.apache.commons.lang.time.FastDateFormatfastDateFormat- 
Fields inherited from class com.wowza.wms.amf.AMFDataAMF_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 SummaryConstructors Constructor Description AMFDataItem()Construct AMF type DATA_TYPE_NULL objectAMFDataItem(boolean value)Construct AMF type DATA_TYPE_BOOLEANAMFDataItem(byte[] data)Deserialize entire data array and create AMFDataItem objectAMFDataItem(byte[] data, int offset, int size)Deserialize data array starting at offest for size bytes and create AMFDataItem objectAMFDataItem(double value)Construct AMF type DATA_TYPE_NUMBER objectAMFDataItem(int value)Construct AMF type DATA_TYPE_NUMBER objectAMFDataItem(long value)Construct AMF type DATA_TYPE_NUMBER objectAMFDataItem(String value)Construct AMF type DATA_TYPE_STRING objectAMFDataItem(java.nio.ByteBuffer data)Deserialize entire data array and create AMFDataItem objectAMFDataItem(java.nio.ByteBuffer data, AMFDataContextDeserialize context)AMFDataItem(java.util.Date value)Construct AMF type DATA_TYPE_DATE
 - 
Method SummaryAll Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanbooleanValue()Return object as boolean.bytebyteValue()Return object as byte.java.util.DatedateValue()Return object as Date.voiddeserialize(java.nio.ByteBuffer data)Deserialize data in byte buffervoiddeserialize(java.nio.ByteBuffer data, AMFDataContextDeserialize context)Deserialize data in byte bufferdoubledoubleValue()Return object as double.floatfloatValue()Return object as float.ObjectgetValue()Return value as Java classintintValue()Return object as int.longlongValue()Return object as long.byte[]serialize()Serial object to byte arraybyte[]serialize(int objectEncoding)Serial object to byte arraybyte[]serialize(AMFDataContextSerialize context)Serial object to byte arrayvoidserialize(java.io.DataOutputStream out)Serialize object to output streamvoidserialize(java.io.DataOutputStream out, int objectEncoding)Serialize object to output streamvoidserialize(java.io.DataOutputStream out, AMFDataContextSerialize context)Serialize object to output streamshortshortValue()Return object as short.StringtoString()Return object as formatted string- 
Methods inherited from class com.wowza.wms.amf.AMFDatacreateContextDeserialize, createContextDeserialize, createContextSerialize, createContextSerialize, deserializeInnerObject, getReference, getType, isAMF3Start, isArrayStart, isByteArrayStart, isMixedArrayStart, isObjEnd, isObjStart, peekByte, setType, skipByte, testNextByte, triggerAMF3Switch
 
- 
 
- 
- 
- 
Field Detail- 
DATEFORMATpublic static final String DATEFORMAT - See Also:
- Constant Field Values
 
 - 
fastDateFormatprotected org.apache.commons.lang.time.FastDateFormat fastDateFormat 
 
- 
 - 
Constructor Detail- 
AMFDataItempublic AMFDataItem() Construct AMF type DATA_TYPE_NULL object
 - 
AMFDataItempublic AMFDataItem(String value) Construct AMF type DATA_TYPE_STRING object- Parameters:
- value- String value
 
 - 
AMFDataItempublic AMFDataItem(int value) Construct AMF type DATA_TYPE_NUMBER object- Parameters:
- value- int value
 
 - 
AMFDataItempublic AMFDataItem(long value) Construct AMF type DATA_TYPE_NUMBER object- Parameters:
- value- long value
 
 - 
AMFDataItempublic AMFDataItem(double value) Construct AMF type DATA_TYPE_NUMBER object- Parameters:
- value- double value
 
 - 
AMFDataItempublic AMFDataItem(boolean value) Construct AMF type DATA_TYPE_BOOLEAN- Parameters:
- value- boolean value
 
 - 
AMFDataItempublic AMFDataItem(java.util.Date value) Construct AMF type DATA_TYPE_DATE- Parameters:
- value- Date value
 
 - 
AMFDataItempublic AMFDataItem(byte[] data) Deserialize entire data array and create AMFDataItem object- Parameters:
- data- binary data
 
 - 
AMFDataItempublic AMFDataItem(byte[] data, int offset, int size)Deserialize data array starting at offest for size bytes and create AMFDataItem object- Parameters:
- data- binary data
- offset- starting offset into data
- size- size of data to deserialize
 
 - 
AMFDataItempublic AMFDataItem(java.nio.ByteBuffer data) Deserialize entire data array and create AMFDataItem object- Parameters:
- data- binary data
 
 - 
AMFDataItempublic AMFDataItem(java.nio.ByteBuffer data, AMFDataContextDeserialize context)
 
- 
 - 
Method Detail- 
longValuepublic long longValue() Return object as long. Valid object types are DATA_TYPE_NUMBER and DATA_TYPE_STRING.- Returns:
- long value or 0 if failure
 
 - 
intValuepublic int intValue() Return object as int. Valid object types are DATA_TYPE_NUMBER and DATA_TYPE_STRING.- Returns:
- int value or 0 if failure
 
 - 
doubleValuepublic double doubleValue() Return object as double. Valid object types are DATA_TYPE_NUMBER and DATA_TYPE_STRING.- Returns:
- double value or 0 if failure
 
 - 
floatValuepublic float floatValue() Return object as float. Valid object types are DATA_TYPE_NUMBER and DATA_TYPE_STRING.- Returns:
- float value or 0 if failure
 
 - 
shortValuepublic short shortValue() Return object as short. Valid object types are DATA_TYPE_NUMBER and DATA_TYPE_STRING.- Returns:
- short value or 0 if failure
 
 - 
byteValuepublic byte byteValue() Return object as byte. Valid object types are DATA_TYPE_NUMBER and DATA_TYPE_STRING.- Returns:
- byte value or 0 if failure
 
 - 
dateValuepublic java.util.Date dateValue() Return object as Date. Valid object types are DATA_TYPE_DATE.- Returns:
- Date value or null if failure
 
 - 
booleanValuepublic boolean booleanValue() Return object as boolean. Valid object types are DATA_TYPE_BOOLEAN and DATA_TYPE_STRING.- Returns:
- boolean value or false if failure
 
 - 
deserializepublic void deserialize(java.nio.ByteBuffer data) Description copied from class:AMFDataDeserialize data in byte buffer- Specified by:
- deserializein class- AMFData
- Parameters:
- data- binary data
 
 - 
deserializepublic void deserialize(java.nio.ByteBuffer data, AMFDataContextDeserialize context)Description copied from class:AMFDataDeserialize data in byte buffer- Specified by:
- deserializein class- AMFData
- Parameters:
- data- binary data
- context- deserialization context used by AMF3
 
 - 
getValuepublic Object getValue() Return value as Java class
 - 
toStringpublic String toString() Return object as formatted string- Overrides:
- toStringin class- Object
 
 - 
serializepublic void serialize(java.io.DataOutputStream out) Description copied from class:AMFDataSerialize object to output stream
 - 
serializepublic void serialize(java.io.DataOutputStream out, int objectEncoding)Description copied from class:AMFDataSerialize object to output stream
 - 
serializepublic void serialize(java.io.DataOutputStream out, AMFDataContextSerialize context)Description copied from class:AMFDataSerialize object to output stream
 - 
serializepublic byte[] serialize() Description copied from class:AMFDataSerial object to byte array
 - 
serializepublic byte[] serialize(int objectEncoding) Description copied from class:AMFDataSerial object to byte array
 - 
serializepublic byte[] serialize(AMFDataContextSerialize context) Description copied from class:AMFDataSerial object to byte array
 
- 
 
-