org.red5.io.amf3
Class Input

java.lang.Object
  extended by org.red5.io.object.BaseInput
      extended by org.red5.io.amf.Input
          extended by org.red5.io.amf3.Input
All Implemented Interfaces:
Input

public class Input
extends Input
implements Input

Input for Red5 data (AMF3) types

Author:
The Red5 Project (red5@osflash.org), Luke Hubbard, Codegent Ltd (luke@codegent.com), Joachim Bauch (jojo@struktur.de)

Nested Class Summary
protected  class Input.ClassReference
          Holds informations about already deserialized classes.
protected  class Input.PendingObject
          Dummy class that is stored as reference for objects currently being deserialized that reference themselves.
static class Input.RefStorage
          Class used to collect AMF3 references.
 
Nested classes/interfaces inherited from class org.red5.io.object.BaseInput
BaseInput.ReferenceMode
 
Field Summary
protected static org.slf4j.Logger log
          Logger
 
Fields inherited from class org.red5.io.amf.Input
buf, currentDataType
 
Fields inherited from class org.red5.io.object.BaseInput
referenceMode, refId, refMap
 
Constructor Summary
Input(org.apache.mina.common.ByteBuffer buf)
          Creates Input object for AMF3 from byte buffer
Input(org.apache.mina.common.ByteBuffer buf, Input.RefStorage refStorage)
          Creates Input object for AMF3 from byte buffer and initializes references from passed RefStorage
 
Method Summary
 void enforceAMF3()
          Force using AMF3 everywhere
protected  org.apache.mina.common.ByteBuffer getBuffer()
          Provide access to raw data.
 String getString()
          Reads string from buffer
protected  Object newInstance(String className)
          Creats a new instance of the className parameter and returns as an Object
 Object readArray(Deserializer deserializer)
          Returns an array
 Boolean readBoolean()
          Reads a boolean
 ByteArray readByteArray()
          Read ByteArray object.
 Object readCustom()
          Reads Custom
 byte readDataType()
          Reads the data type
 Date readDate()
          Returns a date
 Object readMap(Deserializer deserializer)
          Read a map containing key - value pairs.
 Object readNull()
          Reads a null (value)
 Number readNumber()
          Reads a Number
 Object readObject(Deserializer deserializer)
          Reads start object
 Object readReference()
          Reads Reference
 String readString()
          Reads a string
 Document readXML()
          Reads XML
 void reset()
          Resets map
 
Methods inherited from class org.red5.io.amf.Input
getPropertyType, getString, hasMoreProperties, readBean, readDataType, readKeyValues, readKeyValues, readPropertyName, readSimpleObject, reset, skipEndObject, skipPropertySeparator
 
Methods inherited from class org.red5.io.object.BaseInput
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 Detail

log

protected static org.slf4j.Logger log
Logger

Constructor Detail

Input

public Input(org.apache.mina.common.ByteBuffer buf)
Creates Input object for AMF3 from byte buffer

Parameters:
buf - Byte buffer

Input

public Input(org.apache.mina.common.ByteBuffer buf,
             Input.RefStorage refStorage)
Creates Input object for AMF3 from byte buffer and initializes references from passed RefStorage

Parameters:
buf -
refStorage -
Method Detail

enforceAMF3

public void enforceAMF3()
Force using AMF3 everywhere


getBuffer

protected org.apache.mina.common.ByteBuffer getBuffer()
Provide access to raw data.

Returns:
ByteBuffer

readDataType

public byte readDataType()
Reads the data type

Specified by:
readDataType in interface Input
Overrides:
readDataType in class Input
Returns:
byte Data type

readNull

public Object readNull()
Reads a null (value)

Specified by:
readNull in interface Input
Overrides:
readNull in class Input
Returns:
Object null

readBoolean

public Boolean readBoolean()
Reads a boolean

Specified by:
readBoolean in interface Input
Overrides:
readBoolean in class Input
Returns:
boolean Boolean value

readNumber

public Number readNumber()
Reads a Number

Specified by:
readNumber in interface Input
Overrides:
readNumber in class Input
Returns:
Number Number

readString

public String readString()
Reads a string

Specified by:
readString in interface Input
Overrides:
readString in class Input
Returns:
String String

getString

public String getString()
Description copied from class: Input
Reads string from buffer

Specified by:
getString in interface Input
Overrides:
getString in class Input
Returns:
String

readDate

public Date readDate()
Returns a date

Specified by:
readDate in interface Input
Overrides:
readDate in class Input
Returns:
Date Date object

readArray

public Object readArray(Deserializer deserializer)
Returns an array

Specified by:
readArray in interface Input
Overrides:
readArray in class Input
Returns:
int Length of array

readMap

public Object readMap(Deserializer deserializer)
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.

Specified by:
readMap in interface Input
Overrides:
readMap in class Input
Returns:
Map

readObject

public Object readObject(Deserializer deserializer)
Description copied from class: Input
Reads start object

Specified by:
readObject in interface Input
Overrides:
readObject in class Input
Parameters:
deserializer - Deserializer to use
Returns:
Read object

readByteArray

public ByteArray readByteArray()
Description copied from class: Input
Read ByteArray object. This is not supported by the AMF0 deserializer.

Specified by:
readByteArray in interface Input
Overrides:
readByteArray in class Input
Returns:
ByteArray object

readCustom

public Object readCustom()
Reads Custom

Specified by:
readCustom in interface Input
Overrides:
readCustom in class Input
Returns:
Object Custom type object

readReference

public Object readReference()
Reads Reference

Specified by:
readReference in interface Input
Overrides:
readReference in class Input
Returns:
Object Read reference to object

reset

public void reset()
Resets map

Overrides:
reset in class Input

newInstance

protected Object newInstance(String className)
Creats a new instance of the className parameter and returns as an Object

Overrides:
newInstance in class Input
Parameters:
className - Class name as String
Returns:
Object New object instance (for given class)

readXML

public Document readXML()
Reads XML

Specified by:
readXML in interface Input
Overrides:
readXML in class Input
Returns:
String XML as string


Copyright © 2006-2007 the Red5 project.