Package com.wowza.wms.amf
Class AMFData
Object
com.wowza.wms.amf.AMFData
- Direct Known Subclasses:
AMFDataArray
,AMFDataByteArray
,AMFDataItem
,AMFDataList
,AMFDataObj
Base abstract class for data in Action Message Format (AMF). Data is sent between the Flash client and the Wowza Streaming Engine using the AMF format. This class cannot be instantiated. It serves as the base class for all AMFData objects.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic String
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final byte
static final int
Number of milliseconds in an hourprotected int
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic AMFDataContextDeserialize
Create an AMF3 deserialization contextstatic AMFDataContextDeserialize
createContextDeserialize
(int objectEncoding) Create an AMF3 deserialization contextstatic AMFDataContextSerialize
Create an AMF3 serialization contextstatic AMFDataContextSerialize
createContextSerialize
(int objectEncoding) Create an AMF3 serialization contextabstract void
deserialize
(ByteBuffer data) Deserialize data in byte bufferabstract void
deserialize
(ByteBuffer data, AMFDataContextDeserialize context) Deserialize data in byte bufferstatic AMFData
deserializeInnerObject
(ByteBuffer data, AMFDataContextDeserialize context) Deserialize next itemstatic AMFData
getReference
(ByteBuffer data, AMFDataContextDeserialize context) Get AMF3 object referenceint
getType()
Returns the data type for this objectabstract Object
getValue()
Convert object to Java native classstatic boolean
isAMF3Start
(ByteBuffer data, AMFDataContextDeserialize context) Returns true if next byte in data is AMF3 startstatic boolean
isArrayStart
(ByteBuffer data, AMFDataContextDeserialize context) Returns true if next byte in data is an array startstatic boolean
isByteArrayStart
(ByteBuffer data, AMFDataContextDeserialize context) Returns true if next byte is ByteArray startstatic boolean
isMixedArrayStart
(ByteBuffer data, AMFDataContextDeserialize context) Returns true if next byte in data is mixed array startstatic boolean
isObjEnd
(ByteBuffer data, AMFDataContextDeserialize context) Returns true if next byte is object endstatic boolean
isObjStart
(ByteBuffer data, AMFDataContextDeserialize context) Returns true if next byte in data is object startstatic int
peekByte
(ByteBuffer data) Return the next byte in the buffer without incrementing the data positionabstract byte[]
Serial object to byte arrayabstract byte[]
serialize
(int objectEncoding) Serial object to byte arrayabstract byte[]
serialize
(AMFDataContextSerialize context) Serial object to byte arrayabstract void
Serialize object to output streamabstract void
serialize
(DataOutputStream out, int objectEncoding) Serialize object to output streamabstract void
serialize
(DataOutputStream out, AMFDataContextSerialize context) Serialize object to output streamvoid
setType
(int type) Sets the the data type for this objectstatic int
skipByte
(ByteBuffer data) Skip forward one byte in the byte bufferstatic boolean
testNextByte
(ByteBuffer data, int test) Peek at the next value in data to see if its the test valuestatic boolean
triggerAMF3Switch
(AMFData data) Return true if the object is serialized differently in AMF3
-
Field Details
-
DATA_TYPE_UNKNOWN
public static final byte DATA_TYPE_UNKNOWN- See Also:
-
DATA_TYPE_NUMBER
public static final byte DATA_TYPE_NUMBER- See Also:
-
DATA_TYPE_BOOLEAN
public static final byte DATA_TYPE_BOOLEAN- See Also:
-
DATA_TYPE_STRING
public static final byte DATA_TYPE_STRING- See Also:
-
DATA_TYPE_OBJECT
public static final byte DATA_TYPE_OBJECT- See Also:
-
DATA_TYPE_MOVIE_CLIP
public static final byte DATA_TYPE_MOVIE_CLIP- See Also:
-
DATA_TYPE_NULL
public static final byte DATA_TYPE_NULL- See Also:
-
DATA_TYPE_UNDEFINED
public static final byte DATA_TYPE_UNDEFINED- See Also:
-
DATA_TYPE_REFERENCE_OBJECT
public static final byte DATA_TYPE_REFERENCE_OBJECT- See Also:
-
DATA_TYPE_MIXED_ARRAY
public static final byte DATA_TYPE_MIXED_ARRAY- See Also:
-
DATA_TYPE_OBJECT_END
public static final byte DATA_TYPE_OBJECT_END- See Also:
-
DATA_TYPE_ARRAY
public static final byte DATA_TYPE_ARRAY- See Also:
-
DATA_TYPE_DATE
public static final byte DATA_TYPE_DATE- See Also:
-
DATA_TYPE_LONG_STRING
public static final byte DATA_TYPE_LONG_STRING- See Also:
-
DATA_TYPE_AS_OBJECT
public static final byte DATA_TYPE_AS_OBJECT- See Also:
-
DATA_TYPE_RECORDSET
public static final byte DATA_TYPE_RECORDSET- See Also:
-
DATA_TYPE_XML
public static final byte DATA_TYPE_XML- See Also:
-
DATA_TYPE_CUSTOM_CLASS
public static final byte DATA_TYPE_CUSTOM_CLASS- See Also:
-
DATA_TYPE_AMF3
public static final byte DATA_TYPE_AMF3- See Also:
-
DATA_TYPE_INTEGER
public static final byte DATA_TYPE_INTEGER- See Also:
-
DATA_TYPE_BYTEARRAY
public static final byte DATA_TYPE_BYTEARRAY- See Also:
-
DATA_TYPE_XML_TOP
public static final byte DATA_TYPE_XML_TOP- See Also:
-
DATA_TYPE_AMF3_UNDEFINED
public static final byte DATA_TYPE_AMF3_UNDEFINED- See Also:
-
DATA_TYPE_AMF3_NULL
public static final byte DATA_TYPE_AMF3_NULL- See Also:
-
DATA_TYPE_AMF3_BOOLEAN_FALSE
public static final byte DATA_TYPE_AMF3_BOOLEAN_FALSE- See Also:
-
DATA_TYPE_AMF3_BOOLEAN_TRUE
public static final byte DATA_TYPE_AMF3_BOOLEAN_TRUE- See Also:
-
DATA_TYPE_AMF3_INTEGER
public static final byte DATA_TYPE_AMF3_INTEGER- See Also:
-
DATA_TYPE_AMF3_NUMBER
public static final byte DATA_TYPE_AMF3_NUMBER- See Also:
-
DATA_TYPE_AMF3_STRING
public static final byte DATA_TYPE_AMF3_STRING- See Also:
-
DATA_TYPE_AMF3_XML_LEGACY
public static final byte DATA_TYPE_AMF3_XML_LEGACY- See Also:
-
DATA_TYPE_AMF3_DATE
public static final byte DATA_TYPE_AMF3_DATE- See Also:
-
DATA_TYPE_AMF3_ARRAY
public static final byte DATA_TYPE_AMF3_ARRAY- See Also:
-
DATA_TYPE_AMF3_OBJECT
public static final byte DATA_TYPE_AMF3_OBJECT- See Also:
-
DATA_TYPE_AMF3_XML_TOP
public static final byte DATA_TYPE_AMF3_XML_TOP- See Also:
-
DATA_TYPE_AMF3_BYTEARRAY
public static final byte DATA_TYPE_AMF3_BYTEARRAY- See Also:
-
AMF_LEVEL0
public static final byte AMF_LEVEL0- See Also:
-
AMF_LEVEL3
public static final byte AMF_LEVEL3- See Also:
-
AMF_DEFAULT_DESERIALIZE_CHARSETNAME
-
MILLS_PER_HOUR
public static final int MILLS_PER_HOURNumber of milliseconds in an hour- See Also:
-
type
protected int type
-
-
Constructor Details
-
AMFData
public AMFData()
-
-
Method Details
-
getType
public int getType()Returns the data type for this object- Returns:
- object type DATA_TYPE_*
-
setType
public void setType(int type) Sets the the data type for this object- Parameters:
type
- type DATA_TYPE_*
-
testNextByte
Peek at the next value in data to see if its the test value- Parameters:
data
- binary data being deserializedtest
- value being tested- Returns:
- return true if the next byte in the buffer equals the test value
-
peekByte
Return the next byte in the buffer without incrementing the data position- Parameters:
data
- binary data being deserialized- Returns:
- next byte in buffer
-
skipByte
Skip forward one byte in the byte buffer- Parameters:
data
- binary data being deserialized- Returns:
- next byte in buffer
-
isObjStart
Returns true if next byte in data is object start- Parameters:
data
- binary data being deserializedcontext
- deserialization context- Returns:
- Returns true if next byte in data is object start
-
isAMF3Start
Returns true if next byte in data is AMF3 start- Parameters:
data
- binary data being deserializedcontext
- deserialization context- Returns:
- Returns true if next byte in data is object start
-
isArrayStart
Returns true if next byte in data is an array start- Parameters:
data
- binary data being deserializedcontext
- deserialization context- Returns:
- Returns true if next byte in data is and array start
-
isMixedArrayStart
Returns true if next byte in data is mixed array start- Parameters:
data
- binary data being deserializedcontext
- deserialization context- Returns:
- Returns true if next byte in data is mixed array start
-
isObjEnd
Returns true if next byte is object end- Parameters:
data
- binary data being deserializedcontext
- deserialization context- Returns:
- Returns true if next byte in object end
-
isByteArrayStart
Returns true if next byte is ByteArray start- Parameters:
data
- binary data being deserializedcontext
- deserialization context- Returns:
- true if next byte in object end
-
getReference
Get AMF3 object reference- Parameters:
data
- binary data being deserializedcontext
- deserialization context- Returns:
- null if not a reference else referenced object
-
deserializeInnerObject
public static AMFData deserializeInnerObject(ByteBuffer data, AMFDataContextDeserialize context) throws IOException Deserialize next item- Parameters:
data
- binary data being deserializedcontext
- deserialization context- Returns:
- deserialized object
- Throws:
IOException
-
createContextSerialize
Create an AMF3 serialization context- Returns:
- AMF3 serialization context
-
createContextSerialize
Create an AMF3 serialization context- Parameters:
objectEncoding
- object encoding level (see AMF_LEVEL*)- Returns:
- AMF3 serialization context
-
createContextDeserialize
Create an AMF3 deserialization context- Returns:
- AMF3 deserialization context
-
createContextDeserialize
Create an AMF3 deserialization context- Parameters:
objectEncoding
- object encoding level (see AMF_LEVEL*)- Returns:
- AMF3 deserialization context
-
serialize
Serialize object to output stream- Parameters:
out
- Output stream
-
serialize
Serialize object to output stream- Parameters:
out
- Output streamobjectEncoding
- object encoding level (see AMF_LEVEL*)
-
serialize
Serialize object to output stream- Parameters:
out
- Output streamcontext
- serialization context used by AMF3
-
serialize
public abstract byte[] serialize()Serial object to byte array- Returns:
- serialized byte array
-
serialize
public abstract byte[] serialize(int objectEncoding) Serial object to byte array- Parameters:
objectEncoding
- object encoding level (see AMF_LEVEL*)- Returns:
- serialized byte array
-
serialize
Serial object to byte array- Parameters:
context
- serialization context used by AMF3- Returns:
- serialized byte array
-
deserialize
Deserialize data in byte buffer- Parameters:
data
- binary data
-
deserialize
Deserialize data in byte buffer- Parameters:
data
- binary datacontext
- deserialization context used by AMF3
-
getValue
Convert object to Java native class- Returns:
- java native class
-
triggerAMF3Switch
Return true if the object is serialized differently in AMF3- Parameters:
data
- AMF object- Returns:
- true if the object is serialized differently in AMF3
-