Package org.red5.io.amf
Class Input
- java.lang.Object
-
- org.red5.io.object.BaseInput
-
- org.red5.io.amf.Input
-
-
Field Summary
Fields Modifier and Type Field Description protected org.apache.mina.core.buffer.IoBufferbufprotected static Map<String,String>classAliasesprotected bytecurrentDataTypeprotected org.slf4j.Loggerlog
-
Constructor Summary
Constructors Constructor Description Input(org.apache.mina.core.buffer.IoBuffer buf)Creates Input object from byte buffer
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected TypegetPropertyType(Object instance, String propertyName)StringgetString()Reads string from bufferbooleanhasMoreProperties()Returns a boolean stating whether there are more propertiesprotected ObjectnewInstance(String className)Creates a new instance of the className parameter and returns as an ObjectObjectreadArray(Type target)Read an array.protected ObjectreadBean(Object bean)Reads the input as a bean and returns an objectBooleanreadBoolean()Reads a boolean.ByteArrayreadByteArray()Read ByteArray object.ObjectreadCustom()Reads CustombytereadDataType()Reads the data type.DatereadDate()Returns a dateMap<String,Object>readKeyValues()Read key - value pairs.protected voidreadKeyValues(Map<String,Object> result)Read key - value pairs into Map objectObjectreadMap()Read a map containing key - value pairs.ObjectreadNull()Reads a null.NumberreadNumber()Reads a Number.ObjectreadObject()Reads start objectStringreadPropertyName()Reads property nameObjectreadReference()Reads Referenceprotected Map<String,Object>readSimpleObject()Reads the input as a map and returns a MapStringreadString()Reads a stringVector<Integer>readVectorInt()Read Vector<int> object.Vector<Double>readVectorNumber()Read Vector<Number> object.Vector<Object>readVectorObject()Read Vector<Object> object.Vector<Long>readVectorUInt()Read Vector<Long> object.DocumentreadXML()Reads XMLvoidreset()Resets internals.voidskipPropertySeparator()Skips property separator-
Methods inherited from class org.red5.io.object.BaseInput
classAllowed, clearReferences, getReference, storeReference, storeReference
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.red5.io.object.Input
clearReferences
-
-
-
-
Method Detail
-
readDataType
public byte readDataType()
Reads the data type.- Specified by:
readDataTypein interfaceInput- Returns:
- One of AMF class constants with type
- See Also:
AMF
-
readNull
public Object readNull()
Reads a null.
-
readBoolean
public Boolean readBoolean()
Reads a boolean.- Specified by:
readBooleanin interfaceInput- Returns:
- boolean
-
readNumber
public Number readNumber()
Reads a Number. In ActionScript 1 and 2 Number type represents all numbers, both floats and integers.- Specified by:
readNumberin interfaceInput- Returns:
- Number
-
getString
public String getString()
Reads string from buffer
-
readString
public String readString()
Reads a string- Specified by:
readStringin interfaceInput- Returns:
- String
-
readDate
public Date readDate()
Returns a date
-
readArray
public Object readArray(Type target)
Description copied from interface:InputRead an array. This can result in a List or Map being deserialized depending on the array type found.
-
readKeyValues
public Map<String,Object> readKeyValues()
Read key - value pairs. This is required for the RecordSet deserializer.- Specified by:
readKeyValuesin interfaceInput- Returns:
- key-value pairs
-
readKeyValues
protected void readKeyValues(Map<String,Object> result)
Read key - value pairs into Map object- Parameters:
result- Map to put resulting pair to
-
readMap
public Object readMap()
Description copied from interface:InputRead a map containing key - value pairs. This can result in a List or Map being deserialized depending on the map type found.
-
newInstance
protected Object newInstance(String className)
Creates a new instance of the className parameter and returns as an Object- Parameters:
className- Class name as String- Returns:
- Object New object instance (for given class)
-
readBean
protected Object readBean(Object bean)
Reads the input as a bean and returns an object- Parameters:
bean- Input as bean- Returns:
- Decoded object
-
readSimpleObject
protected Map<String,Object> readSimpleObject()
Reads the input as a map and returns a Map- Returns:
- Read map
-
readObject
public Object readObject()
Reads start object- Specified by:
readObjectin interfaceInput- Returns:
- Read object
-
hasMoreProperties
public boolean hasMoreProperties()
Returns a boolean stating whether there are more properties- Returns:
- boolean
trueif there are more properties to read,falseotherwise
-
readPropertyName
public String readPropertyName()
Reads property name- Returns:
- String Object property name
-
skipPropertySeparator
public void skipPropertySeparator()
Skips property separator
-
readXML
public Document readXML()
Reads XML
-
readCustom
public Object readCustom()
Reads Custom- Specified by:
readCustomin interfaceInput- Returns:
- Object Custom type object
-
readByteArray
public ByteArray readByteArray()
Read ByteArray object. This is not supported by the AMF0 deserializer.- Specified by:
readByteArrayin interfaceInput- Returns:
- ByteArray object
-
readVectorInt
public Vector<Integer> readVectorInt()
Read Vector<int> object. This is not supported by the AMF0 deserializer.- Specified by:
readVectorIntin interfaceInput- Returns:
- Vector<Integer> object
-
readVectorUInt
public Vector<Long> readVectorUInt()
Read Vector<Long> object. This is not supported by the AMF0 deserializer.- Specified by:
readVectorUIntin interfaceInput- Returns:
- Vector<Long> object
-
readVectorNumber
public Vector<Double> readVectorNumber()
Read Vector<Number> object. This is not supported by the AMF0 deserializer.- Specified by:
readVectorNumberin interfaceInput- Returns:
- Vector<Double> object
-
readVectorObject
public Vector<Object> readVectorObject()
Read Vector<Object> object. This is not supported by the AMF0 deserializer.- Specified by:
readVectorObjectin interfaceInput- Returns:
- Vector<Object> object
-
readReference
public Object readReference()
Reads Reference- Specified by:
readReferencein interfaceInput- Returns:
- Object Read reference to object
-
-