Package org.red5.io.amf3
Class Input
java.lang.Object
org.red5.io.object.BaseInput
org.red5.io.amf.Input
org.red5.io.amf3.Input
- All Implemented Interfaces:
Input
Input for Red5 data (AMF3) types
- Author:
- The Red5 Project, Luke Hubbard, Codegent Ltd (luke@codegent.com), Joachim Bauch (jojo@struktur.de)
-
Nested Class Summary
Modifier and TypeClassDescriptionprotected static class
Holds informations about already deserialized classes.protected static class
Dummy class that is stored as reference for objects currently being deserialized that reference themselves.static class
Class used to collect AMF3 references. -
Field Summary
Modifier and TypeFieldDescriptionprivate int
Set to a value above 0 to enforce AMF3 decoding mode.private Input.RefStorage
Stores references declared in this input of previous ones in the same message bodyFields inherited from class org.red5.io.amf.Input
buf, classAliases, currentDataType, log
-
Constructor Summary
ConstructorDescriptionInput
(org.apache.mina.core.buffer.IoBuffer buf) Creates Input object for AMF3 from byte bufferInput
(org.apache.mina.core.buffer.IoBuffer buf, Input.RefStorage refStorage) Creates Input object for AMF3 from byte buffer and initializes references from passed RefStorage -
Method Summary
Modifier and TypeMethodDescriptionvoid
Force using AMF3 everywhereprotected org.apache.mina.core.buffer.IoBuffer
Provide access to raw data.Reads string from bufferprivate int
Returns an arrayReads a booleanRead ByteArray object.Reads Custombyte
Reads the data typereadDate()
Returns a dateprivate int
Parser of AMF3 "compressed" integer data typereadMap()
Read a map containing key - value pairs.readNull()
Reads a null (value)Reads a NumberReads start objectReads ReferenceReads a stringreadString
(int length) Reads a string of a set length.Read Vector<Integer> object.Read Vector<Number> object.Read Vector<Object> object.Read Vector<uint> object.readXML()
Reads XMLvoid
reset()
Resets internals.Methods inherited from class org.red5.io.amf.Input
getPropertyType, hasMoreProperties, newInstance, readBean, readKeyValues, readKeyValues, readPropertyName, readSimpleObject, skipPropertySeparator
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, readKeyValues
-
Field Details
-
amf3_mode
private int amf3_modeSet to a value above 0 to enforce AMF3 decoding mode. -
refStorage
Stores references declared in this input of previous ones in the same message body
-
-
Constructor Details
-
Input
public Input(org.apache.mina.core.buffer.IoBuffer buf) Creates Input object for AMF3 from byte buffer- Parameters:
buf
- Byte buffer
-
Input
Creates Input object for AMF3 from byte buffer and initializes references from passed RefStorage- Parameters:
buf
- bufferrefStorage
- ref storage
-
-
Method Details
-
enforceAMF3
public void enforceAMF3()Force using AMF3 everywhere -
getBuffer
protected org.apache.mina.core.buffer.IoBuffer getBuffer()Provide access to raw data.- Returns:
- IoBuffer
-
readDataType
public byte readDataType()Reads the data type- Specified by:
readDataType
in interfaceInput
- Overrides:
readDataType
in classInput
- Returns:
- byte Data type
- See Also:
-
readNull
Reads a null (value) -
readBoolean
Reads a boolean- Specified by:
readBoolean
in interfaceInput
- Overrides:
readBoolean
in classInput
- Returns:
- boolean Boolean value
-
readNumber
Reads a Number- Specified by:
readNumber
in interfaceInput
- Overrides:
readNumber
in classInput
- Returns:
- Number Number
-
readString
Reads a string- Specified by:
readString
in interfaceInput
- Overrides:
readString
in classInput
- Returns:
- String String
-
readString
Reads a string of a set length. This does not use the string reference table.- Parameters:
length
- the length of the string- Returns:
- String
-
getRefStorage
-
getString
Description copied from class:Input
Reads string from buffer -
readDate
Returns a date -
readArray
Returns an array -
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. -
readObject
Description copied from class:Input
Reads start object- Specified by:
readObject
in interfaceInput
- Overrides:
readObject
in classInput
- Returns:
- Read object
-
readByteArray
Read ByteArray object.- Specified by:
readByteArray
in interfaceInput
- Overrides:
readByteArray
in classInput
- Returns:
- ByteArray object
-
readVectorInt
Read Vector<Integer> object.- Specified by:
readVectorInt
in interfaceInput
- Overrides:
readVectorInt
in classInput
- Returns:
- Vector<Integer> object
-
readVectorUInt
Read Vector<uint> object.- Specified by:
readVectorUInt
in interfaceInput
- Overrides:
readVectorUInt
in classInput
- Returns:
- Vector<Long> object
-
readVectorNumber
Read Vector<Number> object.- Specified by:
readVectorNumber
in interfaceInput
- Overrides:
readVectorNumber
in classInput
- Returns:
- Vector<Double> object
-
readVectorObject
Read Vector<Object> object.- Specified by:
readVectorObject
in interfaceInput
- Overrides:
readVectorObject
in classInput
- Returns:
- Vector<Object> object
-
readCustom
Reads Custom- Specified by:
readCustom
in interfaceInput
- Overrides:
readCustom
in classInput
- Returns:
- Object Custom type object
-
readReference
Reads Reference- Specified by:
readReference
in interfaceInput
- Overrides:
readReference
in classInput
- Returns:
- Object Read reference to object
-
readInteger
private int readInteger()Parser of AMF3 "compressed" integer data type- Returns:
- a converted integer value
-
readAMF3IntegerNew
private int readAMF3IntegerNew() -
readXML
Reads XML -
reset
public void reset()Resets internals.
-