Class Input

All Implemented Interfaces:
Input
Direct Known Subclasses:
Input

public class Input extends BaseInput implements Input
Input for Red5 data types
Author:
The Red5 Project, Luke Hubbard, Codegent Ltd (luke@codegent.com), Paul Gregoire (mondain@gmail.com)
  • Field Details

    • log

      protected org.slf4j.Logger log
    • classAliases

      protected static Map<String,String> classAliases
      Constant 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()
      Read type of data Reads the data type.
      Specified by:
      readDataType in interface Input
      Returns:
      Type of data as byte
      See Also:
    • readNull

      public Object readNull()
      Read Null data type Reads a null.
      Specified by:
      readNull in interface Input
      Returns:
      Null datatype (AS)
    • readBoolean

      public Boolean readBoolean()
      Read Boolean value Reads a boolean.
      Specified by:
      readBoolean in interface Input
      Returns:
      Boolean
    • readNumber

      public Number 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 interface Input
      Returns:
      Number
    • getString

      public String getString()
      Read a string without the string type header. Reads string from buffer
      Specified by:
      getString in interface Input
      Returns:
      String
    • readString

      public String readString()
      Read String object Reads a string
      Specified by:
      readString in interface Input
      Returns:
      String
    • readDate

      public Date readDate()
      Read date object Returns a date
      Specified by:
      readDate in interface Input
      Returns:
      Date
    • readArray

      public Object readArray(Type target)
      Read an array. This can result in a List or Map being deserialized depending on the array type found.
      Specified by:
      readArray in interface Input
      Parameters:
      target - target type
      Returns:
      array
    • readKeyValues

      public Map<String,Object> 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 interface Input
      Returns:
      key-value pairs
    • readKeyValues

      protected void readKeyValues(Map<String,Object> result)
      Read key - value pairs into Map object
      Parameters:
      result - Map to put resulting pair to
    • readMap

      public Object readMap()
      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
      Returns:
      Map
    • newInstance

      protected Object newInstance(String className)
      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

      protected Object readBean(Object bean)
      Reads the input as a bean and returns an object
      Parameters:
      bean - Input as bean
      Returns:
      Decoded object
    • readSimpleObject

      protected Map<String,Object> readSimpleObject()
      Reads the input as a map and returns a Map
      Returns:
      Read map
    • readObject

      public Object readObject()
      Read an object. Reads start object
      Specified by:
      readObject in interface Input
      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

      public String readPropertyName()
      Reads property name
      Returns:
      String Object property name
    • skipPropertySeparator

      public void skipPropertySeparator()
      Skips property separator
    • readXML

      public Document readXML()
      Read XML document Reads XML
      Specified by:
      readXML in interface Input
      Returns:
      XML DOM document
    • readCustom

      public Object readCustom()
      Read custom object Reads Custom
      Specified by:
      readCustom in interface Input
      Returns:
      Custom object
    • readByteArray

      public ByteArray readByteArray()
      Read ByteArray object. Read ByteArray object. This is not supported by the AMF0 deserializer.
      Specified by:
      readByteArray in interface Input
      Returns:
      ByteArray object
    • readVectorInt

      public Vector<Integer> readVectorInt()
      Read Vector<int> object. Read Vector<int> object. This is not supported by the AMF0 deserializer.
      Specified by:
      readVectorInt in interface Input
      Returns:
      Vector<Integer>
    • readVectorUInt

      public Vector<Long> readVectorUInt()
      Read Vector<uint> object. Read Vector<Long> object. This is not supported by the AMF0 deserializer.
      Specified by:
      readVectorUInt in interface Input
      Returns:
      Vector<Long>
    • readVectorNumber

      public Vector<Double> readVectorNumber()
      Read Vector<Number> object. Read Vector<Number> object. This is not supported by the AMF0 deserializer.
      Specified by:
      readVectorNumber in interface Input
      Returns:
      Vector<Double>
    • readVectorObject

      public Vector<Object> readVectorObject()
      Read Vector<Object> object. Read Vector<Object> object. This is not supported by the AMF0 deserializer.
      Specified by:
      readVectorObject in interface Input
      Returns:
      Vector<Object>
    • readReference

      public 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 interface Input
      Returns:
      object
    • reset

      public void reset()
      Resets internals.
      Specified by:
      reset in interface Input
    • getPropertyType

      protected Type getPropertyType(Object instance, String propertyName)

      getPropertyType.

      Parameters:
      instance - a Object object
      propertyName - a String object
      Returns:
      a Type object