Package org.red5.io.amf
Class Input
java.lang.Object
org.red5.io.object.BaseInput
org.red5.io.amf.Input
- All Implemented Interfaces:
Input
- Direct Known Subclasses:
Input
Input for Red5 data types
- Author:
- The Red5 Project, Luke Hubbard, Codegent Ltd (luke@codegent.com), Paul Gregoire (mondain@gmail.com)
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.mina.core.buffer.IoBuffer
ConstantclassAliases
protected byte
protected org.slf4j.Logger
-
Constructor Summary
ConstructorsConstructorDescriptionInput
(org.apache.mina.core.buffer.IoBuffer buf) Creates Input object from byte buffer -
Method Summary
Modifier and TypeMethodDescriptionprotected Type
getPropertyType
(Object instance, String propertyName) getPropertyType.Read a string without the string type header.boolean
Returns a boolean stating whether there are more propertiesprotected Object
newInstance
(String className) Creates a new instance of the className parameter and returns as an ObjectRead an array.protected Object
Reads the input as a bean and returns an objectRead Boolean valueRead ByteArray object.Read custom objectbyte
Read type of datareadDate()
Read date objectRead key - value pairs.protected void
readKeyValues
(Map<String, Object> result) Read key - value pairs into Map objectreadMap()
Read a map containing key - value pairs.readNull()
Read Null data typeRead Number objectRead an object.Reads property nameRead reference to Complex Data Type.Reads the input as a map and returns a MapRead String objectRead Vector<int> object.Read Vector<Number> object.Read Vector<Object> object.Read Vector<uint> object.readXML()
Read XML documentvoid
reset()
Resets internals.void
Skips property separatorMethods 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
-
Field Details
-
log
protected org.slf4j.Logger log -
classAliases
ConstantclassAliases
-
buf
protected org.apache.mina.core.buffer.IoBuffer buf -
currentDataType
protected byte currentDataType
-
-
Constructor Details
-
Input
public Input(org.apache.mina.core.buffer.IoBuffer buf) Creates Input object from byte buffer- Parameters:
buf
- Byte buffer
-
-
Method Details
-
readDataType
public byte readDataType()Read type of data Reads the data type.- Specified by:
readDataType
in interfaceInput
- Returns:
- Type of data as byte
- See Also:
-
readNull
Read Null data type Reads a null. -
readBoolean
Read Boolean value Reads a boolean.- Specified by:
readBoolean
in interfaceInput
- Returns:
- Boolean
-
readNumber
Read Number object Reads a Number. In ActionScript 1 and 2 Number type represents all numbers, both floats and integers.- Specified by:
readNumber
in interfaceInput
- Returns:
- Number
-
getString
Read a string without the string type header. Reads string from buffer -
readString
Read String object Reads a string- Specified by:
readString
in interfaceInput
- Returns:
- String
-
readDate
Read date object Returns a date -
readArray
Read an array. This can result in a List or Map being deserialized depending on the array type found. -
readKeyValues
Read key - value pairs. This is required for the RecordSet deserializer. Read key - value pairs. This is required for the RecordSet deserializer.- Specified by:
readKeyValues
in interfaceInput
- Returns:
- key-value pairs
-
readKeyValues
Read key - value pairs into Map object- Parameters:
result
- Map to put resulting pair to
-
readMap
Read a map containing key - value pairs. This can result in a List or Map being deserialized depending on the map type found. -
newInstance
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
Reads the input as a bean and returns an object- Parameters:
bean
- Input as bean- Returns:
- Decoded object
-
readSimpleObject
Reads the input as a map and returns a Map- Returns:
- Read map
-
readObject
Read an object. Reads start object- Specified by:
readObject
in interfaceInput
- Returns:
- object
-
hasMoreProperties
public boolean hasMoreProperties()Returns a boolean stating whether there are more properties- Returns:
- boolean
true
if there are more properties to read,false
otherwise
-
readPropertyName
Reads property name- Returns:
- String Object property name
-
skipPropertySeparator
public void skipPropertySeparator()Skips property separator -
readXML
Read XML document Reads XML -
readCustom
Read custom object Reads Custom- Specified by:
readCustom
in interfaceInput
- Returns:
- Custom object
-
readByteArray
Read ByteArray object. Read ByteArray object. This is not supported by the AMF0 deserializer.- Specified by:
readByteArray
in interfaceInput
- Returns:
- ByteArray object
-
readVectorInt
Read Vector<int> object. Read Vector<int> object. This is not supported by the AMF0 deserializer.- Specified by:
readVectorInt
in interfaceInput
- Returns:
- Vector<Integer>
-
readVectorUInt
Read Vector<uint> object. Read Vector<Long> object. This is not supported by the AMF0 deserializer.- Specified by:
readVectorUInt
in interfaceInput
- Returns:
- Vector<Long>
-
readVectorNumber
Read Vector<Number> object. Read Vector<Number> object. This is not supported by the AMF0 deserializer.- Specified by:
readVectorNumber
in interfaceInput
- Returns:
- Vector<Double>
-
readVectorObject
Read Vector<Object> object. Read Vector<Object> object. This is not supported by the AMF0 deserializer.- Specified by:
readVectorObject
in interfaceInput
- Returns:
- Vector<Object>
-
readReference
Read reference to Complex Data Type. Objects that are collaborators (properties) of other objects must be stored as references in map of id-reference pairs. Reads Reference- Specified by:
readReference
in interfaceInput
- Returns:
- object
-
reset
public void reset()Resets internals. -
getPropertyType
getPropertyType.
-