Class Input

All Implemented Interfaces:
Input

public class Input extends Input implements Input
Input for Red5 data (AMF3) types
Author:
The Red5 Project, Luke Hubbard, Codegent Ltd (luke@codegent.com), Joachim Bauch (jojo@struktur.de)
  • Field Details

    • amf3_mode

      private int amf3_mode
      Set to a value above 0 to enforce AMF3 decoding mode.
    • refStorage

      private Input.RefStorage 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

      public Input(org.apache.mina.core.buffer.IoBuffer buf, Input.RefStorage refStorage)
      Creates Input object for AMF3 from byte buffer and initializes references from passed RefStorage
      Parameters:
      buf - buffer
      refStorage - 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 interface Input
      Overrides:
      readDataType in class Input
      Returns:
      byte Data type
      See Also:
    • 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
    • readString

      public String readString(int length)
      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

      public Input.RefStorage getRefStorage()
    • 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(Type target)
      Returns an array
      Specified by:
      readArray in interface Input
      Overrides:
      readArray in class Input
      Parameters:
      target - target type
      Returns:
      int Length of array
    • readMap

      public Object 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.
      Specified by:
      readMap in interface Input
      Overrides:
      readMap in class Input
      Returns:
      Map
    • readObject

      public Object readObject()
      Description copied from class: Input
      Reads start object
      Specified by:
      readObject in interface Input
      Overrides:
      readObject in class Input
      Returns:
      Read object
    • readByteArray

      public ByteArray readByteArray()
      Read ByteArray object.
      Specified by:
      readByteArray in interface Input
      Overrides:
      readByteArray in class Input
      Returns:
      ByteArray object
    • readVectorInt

      public Vector<Integer> readVectorInt()
      Read Vector<Integer> object.
      Specified by:
      readVectorInt in interface Input
      Overrides:
      readVectorInt in class Input
      Returns:
      Vector<Integer> object
    • readVectorUInt

      public Vector<Long> readVectorUInt()
      Read Vector<uint> object.
      Specified by:
      readVectorUInt in interface Input
      Overrides:
      readVectorUInt in class Input
      Returns:
      Vector<Long> object
    • readVectorNumber

      public Vector<Double> readVectorNumber()
      Read Vector<Number> object.
      Specified by:
      readVectorNumber in interface Input
      Overrides:
      readVectorNumber in class Input
      Returns:
      Vector<Double> object
    • readVectorObject

      public Vector<Object> readVectorObject()
      Read Vector<Object> object.
      Specified by:
      readVectorObject in interface Input
      Overrides:
      readVectorObject in class Input
      Returns:
      Vector<Object> 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
    • readInteger

      private int readInteger()
      Parser of AMF3 "compressed" integer data type
      Returns:
      a converted integer value
    • readAMF3IntegerNew

      private int readAMF3IntegerNew()
    • readXML

      public Document readXML()
      Reads XML
      Specified by:
      readXML in interface Input
      Overrides:
      readXML in class Input
      Returns:
      String XML as string
    • reset

      public void reset()
      Resets internals.
      Specified by:
      reset in interface Input
      Overrides:
      reset in class Input