Class 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.

    • 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 data
        offset - starting offset into data
        size - size of data to deserialize
      • AMFDataMixedArray

        public AMFDataMixedArray​(java.nio.ByteBuffer data)
        Deserialize entire data array and create AMFDataMixedArray object
        Parameters:
        data - binary data
    • Method Detail

      • deserialize

        public void deserialize​(java.nio.ByteBuffer data)
        Description copied from class: AMFData
        Deserialize data in byte buffer
        Overrides:
        deserialize in class AMFDataObj
        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 class AMFDataObj
        Parameters:
        data - binary data
        context - 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 class AMFDataObj
        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 class AMFDataObj
        Parameters:
        out - Output stream
        objectEncoding - 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 class AMFDataObj
        Parameters:
        out - Output stream
        context - serialization context used by AMF3
      • toString

        public String toString()
        Return object as formatted string
        Overrides:
        toString in class AMFDataObj