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
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 TypeMethodDescriptionprivate final String
bufferToString
(byte[] str) Converts the bytes into a string.protected Type
getPropertyType
(Object instance, String propertyName) Reads string from bufferboolean
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 objectReads a boolean.Read ByteArray object.Reads Custombyte
Reads the data type.readDate()
Returns a dateRead 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()
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 XMLvoid
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
-
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:
readDataType
in interfaceInput
- Returns:
- One of AMF class constants with type
- See Also:
-
readNull
Reads a null. -
readBoolean
Reads a boolean.- Specified by:
readBoolean
in interfaceInput
- Returns:
- boolean
-
readNumber
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
Reads string from buffer -
readString
Reads a string- Specified by:
readString
in 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:Input
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.- 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
Description copied from interface:Input
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
Reads start object- Specified by:
readObject
in interfaceInput
- Returns:
- Read 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
Reads XML -
readCustom
Reads Custom- Specified by:
readCustom
in interfaceInput
- Returns:
- Object Custom type object
-
readByteArray
Read ByteArray object. This is not supported by the AMF0 deserializer.- Specified by:
readByteArray
in interfaceInput
- Returns:
- ByteArray object
-
readVectorInt
Read Vector<int> object. This is not supported by the AMF0 deserializer.- Specified by:
readVectorInt
in interfaceInput
- Returns:
- Vector<Integer> object
-
readVectorUInt
Read Vector<Long> object. This is not supported by the AMF0 deserializer.- Specified by:
readVectorUInt
in interfaceInput
- Returns:
- Vector<Long> object
-
readVectorNumber
Read Vector<Number> object. This is not supported by the AMF0 deserializer.- Specified by:
readVectorNumber
in interfaceInput
- Returns:
- Vector<Double> object
-
readVectorObject
Read Vector<Object> object. This is not supported by the AMF0 deserializer.- Specified by:
readVectorObject
in interfaceInput
- Returns:
- Vector<Object> object
-
readReference
Reads Reference- Specified by:
readReference
in interfaceInput
- Returns:
- Object Read reference to object
-
reset
public void reset()Resets internals. -
getPropertyType
-