Package com.wowza.wms.amf
Class AMFDataByteArray
- Object
- 
- com.wowza.wms.amf.AMFData
- 
- com.wowza.wms.amf.AMFDataByteArray
 
 
- 
 public class AMFDataByteArray extends AMFData AMFDataByteArray: class for marshalling data between Wowza Pro server and Flash client. This class is a simple byte array. 
- 
- 
Field Summary- 
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 AMFDataByteArray()Create empty AMFDataByteArray objectAMFDataByteArray(byte[] data)Deserialize entire byte array and create AMFDataByteArray object.AMFDataByteArray(byte[] data, int offset, int size)Deserialize data array starting at offest for size bytes and create AMFDataByteArray object.AMFDataByteArray(java.nio.ByteBuffer data)Deserialize entire data array and create AMFDataByteArray object.AMFDataByteArray(java.nio.ByteBuffer data, AMFDataContextDeserialize context)Deserialize entire data array and create AMFDataByteArray object.
 - 
Method SummaryAll Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description intcompress()Compress the internal buffer using the ZLIB compression libraryintdecompress()Decompress the internal buffer using the ZLIB compression libraryvoiddeserialize(java.nio.ByteBuffer data)Deserialize data in byte buffervoiddeserialize(java.nio.ByteBuffer data, AMFDataContextDeserialize context)Deserialize data in byte bufferObjectgetValue()Returns the underlying byte[] data bufferbyte[]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 streamintsize()Returns the number of bytes in the byte arraybyte[]toArray()Returns the underlying data buffer (not a copy)java.nio.ByteBuffertoByteBuffer()Wraps the underlying data buffer with a ByteBuffer object.StringtoString()Return object as formatted stringstatic AMFDataByteArraywrap(byte[] data)Wraps a byte[] into a AMFDataByteArray.static AMFDataByteArraywrap(java.nio.ByteBuffer data)Wraps a ByteBuffer into a AMFDataByteArray.- 
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
 
- 
 
- 
- 
- 
Constructor Detail- 
AMFDataByteArraypublic AMFDataByteArray() Create empty AMFDataByteArray object
 - 
AMFDataByteArraypublic AMFDataByteArray(byte[] data) Deserialize entire byte array and create AMFDataByteArray object. Note: This is for AMF3 deserialization and cannot be used to create an AMFDataByteArray with the passed in data. To create a new AMDDataByteArray from either a byte[] or ByteBuffer, use the static wrap method.- Parameters:
- data- binary data
 
 - 
AMFDataByteArraypublic AMFDataByteArray(byte[] data, int offset, int size)Deserialize data array starting at offest for size bytes and create AMFDataByteArray object. Note: This is for AMF3 deserialization and cannot be used to create an AMFDataByteArray with the passed in data. To create a new AMDDataByteArray from either a byte[] or ByteBuffer, use the static wrap method.- Parameters:
- data- binary data
- offset- starting offset into data
- size- size of data to deserialize
 
 - 
AMFDataByteArraypublic AMFDataByteArray(java.nio.ByteBuffer data) Deserialize entire data array and create AMFDataByteArray object. Note: This is for AMF3 deserialization and cannot be used to create an AMFDataByteArray with the passed in data. To create a new AMDDataByteArray from either a byte[] or ByteBuffer, use the static wrap method.- Parameters:
- data- binary data
 
 - 
AMFDataByteArraypublic AMFDataByteArray(java.nio.ByteBuffer data, AMFDataContextDeserialize context)Deserialize entire data array and create AMFDataByteArray object. Note: This is for AMF3 deserialization and cannot be used to create an AMFDataByteArray with the passed in data. To create a new AMDDataByteArray from either a byte[] or ByteBuffer, use the static wrap method.- Parameters:
- data- binary data
- context- deserialization context (used for AMF3 decoding)
 
 
- 
 - 
Method Detail- 
sizepublic int size() Returns the number of bytes in the byte array- Returns:
- number of bytes in the array
 
 - 
toArraypublic byte[] toArray() Returns the underlying data buffer (not a copy)- Returns:
- data buffer (not a copy)
 
 - 
toByteBufferpublic java.nio.ByteBuffer toByteBuffer() Wraps the underlying data buffer with a ByteBuffer object.- Returns:
- byte[] wrapped as ByteBuffer
 
 - 
wrappublic static AMFDataByteArray wrap(byte[] data) Wraps a byte[] into a AMFDataByteArray. Note: This method does not copy the array.- Parameters:
- data- byte[] data
- Returns:
- wrapped byte[]
 
 - 
wrappublic static AMFDataByteArray wrap(java.nio.ByteBuffer data) Wraps a ByteBuffer into a AMFDataByteArray. Note: This method only copies the ByteBuffer data if the ByteBuffer.array() method fails.- Parameters:
- data- ByteBuffer data
- Returns:
- wrapped ByteBuffer
 
 - 
getValuepublic Object getValue() Returns the underlying byte[] data buffer
 - 
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
 
 - 
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
 - 
compresspublic int compress() Compress the internal buffer using the ZLIB compression library- Returns:
- size of compressed buffer
 
 - 
decompresspublic int decompress() Decompress the internal buffer using the ZLIB compression library- Returns:
- size of decompressed buffer
 
 - 
toStringpublic String toString() Return object as formatted string- Overrides:
- toStringin class- Object
 
 
- 
 
-