## 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

    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 static class` `Input.ClassReference` Holds informations about already deserialized classes.
`protected static 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.

Field Summary
`protected static Logger` `log` Logger

Fields inherited from class org.red5.io.amf.Input
`buf, classAliases, currentDataType`

Fields inherited from class org.red5.io.object.BaseInput
`refId, refMap`

Constructor Summary
`Input(IoBuffer buf)` Creates Input object for AMF3 from byte buffer
`Input(IoBuffer 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 IoBuffer` `getBuffer()` Provide access to raw data.
`String` `getString()` Reads string from buffer
`Object` `readArray(Deserializer deserializer, Type target)` Returns an array
`Boolean` `readBoolean(Type target)` Reads a boolean
`ByteArray` `readByteArray(Type target)` Read ByteArray object.
`Object` `readCustom(Type target)` Reads Custom
`byte` `readDataType()` Reads the data type
`Date` `readDate(Type target)` Returns a date
`Object` `readMap(Deserializer deserializer, Type target)` Read a map containing key - value pairs.
`Object` `readNull(Type target)` Reads a null (value)
`Number` `readNumber(Type target)` Reads a Number
`Object` `readObject(Deserializer deserializer, Type target)` Reads start object
`Object` `readReference(Type target)` Reads Reference
`String` `readString(int length)` Reads a string of a set length.
`String` `readString(Type target)` Reads a string
`Document` `readXML(Type target)` Reads XML
`void` `reset()` Resets map

Methods inherited from class org.red5.io.amf.Input
`getPropertyType, getString, hasMoreProperties, newInstance, readBean, readDataType, readKeyValues, readKeyValues, readPropertyName, readSimpleObject, 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 Logger log

  Logger

Constructor Detail

### Input

    public Input(IoBuffer buf)

  Creates Input object for AMF3 from byte buffer

  Parameters:
    `buf` - Byte buffer

### Input

    public Input(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 Detail

### enforceAMF3

    public void enforceAMF3()

  Force using AMF3 everywhere

### getBuffer

    protected 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

### readNull

    public Object readNull(Type target)

  Reads a null (value)

  Specified by:
    `readNull` in interface `Input`
  Overrides:
    `readNull` in class `Input`
  Parameters:
    `target` - target type
  Returns:
    Object null

### readBoolean

    public Boolean readBoolean(Type target)

  Reads a boolean

  Specified by:
    `readBoolean` in interface `Input`
  Overrides:
    `readBoolean` in class `Input`
  Parameters:
    `target` - target type
  Returns:
    boolean Boolean value

### readNumber

    public Number readNumber(Type target)

  Reads a Number

  Specified by:
    `readNumber` in interface `Input`
  Overrides:
    `readNumber` in class `Input`
  Parameters:
    `target` - target type
  Returns:
    Number Number

### readString

    public String readString(Type target)

  Reads a string

  Specified by:
    `readString` in interface `Input`
  Overrides:
    `readString` in class `Input`
  Parameters:
    `target` - target type
  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

### 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(Type target)

  Returns a date

  Specified by:
    `readDate` in interface `Input`
  Overrides:
    `readDate` in class `Input`
  Parameters:
    `target` - target type
  Returns:
    Date Date object

### readArray

    public Object readArray(Deserializer deserializer,
                            Type target)

  Returns an array

  Specified by:
    `readArray` in interface `Input`
  Overrides:
    `readArray` in class `Input`
  Parameters:
    `deserializer` - deserializer
    `target` - target type
  Returns:
    int Length of array

### readMap

    public Object readMap(Deserializer deserializer,
                          Type target)

  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`
  Parameters:
    `deserializer` - deserializer
    `target` - target type
  Returns:
    Map

### readObject

    public Object readObject(Deserializer deserializer,
                             Type target)

  Description copied from class: `Input`
  Reads start object

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

### readByteArray

    public ByteArray readByteArray(Type target)

  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`
  Parameters:
    `target` - target type
  Returns:
    ByteArray object

### readCustom

    public Object readCustom(Type target)

  Reads Custom

  Specified by:
    `readCustom` in interface `Input`
  Overrides:
    `readCustom` in class `Input`
  Parameters:
    `target` - target type
  Returns:
    Object Custom type object

### readReference

    public Object readReference(Type target)

  Reads Reference

  Specified by:
    `readReference` in interface `Input`
  Overrides:
    `readReference` in class `Input`
  Parameters:
    `target` - target type
  Returns:
    Object Read reference to object

### reset

    public void reset()

  Resets map

  Overrides:
    `reset` in class `Input`

### readXML

    public Document readXML(Type target)

  Reads XML

  Specified by:
    `readXML` in interface `Input`
  Overrides:
    `readXML` in class `Input`
  Parameters:
    `target` - target type
  Returns:
    String XML as string

Copyright © 2006-2010 The Red5 Project