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 ([email protected]), Paul Gregoire ([email protected])
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected org.apache.mina.core.buffer.IoBufferprotected byteprotected org.slf4j.Logger -
Constructor Summary
ConstructorsConstructorDescriptionInput(org.apache.mina.core.buffer.IoBuffer buf) Creates Input object from byte buffer -
Method Summary
Modifier and TypeMethodDescriptionprivate final StringbufferToString(byte[] str) Converts the bytes into a string.protected TypegetPropertyType(Object instance, String propertyName) Reads string from bufferbooleanReturns a boolean stating whether there are more propertiesprotected ObjectnewInstance(String className) Creates a new instance of the className parameter and returns as an ObjectRead an array.protected ObjectReads the input as a bean and returns an objectReads a boolean.Read ByteArray object.Reads CustombyteReads the data type.readDate()Returns a dateRead key - value pairs.protected voidreadKeyValues(Map<String, Object> result) Read key - value pairs into Map objectreadMap()Read a map containing key - value pairs.readNull()Reads a null.Reads a Number.Reads start objectReads property nameReads ReferenceReads the input as a map and returns a MapReads a stringRead Vector<int> object.Read Vector<Number> object.Read Vector<Object> object.Read Vector<Long> object.readXML()Reads XMLvoidreset()Resets internals.voidSkips property separatorMethods inherited from class org.red5.io.object.BaseInput
classAllowed, clearReferences, getReference, storeReference, storeReferenceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.red5.io.object.Input
clearReferences
-
Field Details
-
log
protected org.slf4j.Logger log -
classAliases
-
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()Reads the data type.- Specified by:
readDataTypein interfaceInput- Returns:
- One of AMF class constants with type
- See Also:
-
readNull
Reads a null. -
readBoolean
Reads a boolean.- Specified by:
readBooleanin interfaceInput- Returns:
- boolean
-
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
Reads string from buffer -
readString
Reads a string- Specified by:
readStringin interfaceInput- Returns:
- String
-
bufferToString
Converts the bytes into a string.- Parameters:
str- string bytes- Returns:
- decoded String
-
readDate
Returns a date -
readArray
Description copied from interface:InputRead 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.- Specified by:
readKeyValuesin interfaceInput- Returns:
- key-value pairs
-
readKeyValues
Read key - value pairs into Map object- Parameters:
result- Map to put resulting pair to
-
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
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
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
Reads property name- Returns:
- String Object property name
-
skipPropertySeparator
public void skipPropertySeparator()Skips property separator -
readXML
Reads XML -
readCustom
Reads Custom- Specified by:
readCustomin interfaceInput- Returns:
- Object Custom type object
-
readByteArray
Read ByteArray object. This is not supported by the AMF0 deserializer.- Specified by:
readByteArrayin interfaceInput- Returns:
- ByteArray object
-
readVectorInt
Read Vector<int> object. This is not supported by the AMF0 deserializer.- Specified by:
readVectorIntin interfaceInput- Returns:
- Vector<Integer> object
-
readVectorUInt
Read Vector<Long> object. This is not supported by the AMF0 deserializer.- Specified by:
readVectorUIntin interfaceInput- Returns:
- Vector<Long> object
-
readVectorNumber
Read Vector<Number> object. This is not supported by the AMF0 deserializer.- Specified by:
readVectorNumberin interfaceInput- Returns:
- Vector<Double> object
-
readVectorObject
Read Vector<Object> object. This is not supported by the AMF0 deserializer.- Specified by:
readVectorObjectin interfaceInput- Returns:
- Vector<Object> object
-
readReference
Reads Reference- Specified by:
readReferencein interfaceInput- Returns:
- Object Read reference to object
-
reset
public void reset()Resets internals. -
getPropertyType
-