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

Nested Classes
`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

Fields
`protected static org.slf4j.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

Constructors
Constructor and Description
`Input(org.apache.mina.core.buffer.IoBuffer buf)` Creates Input object for AMF3 from byte buffer
`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

### Method Summary

Methods
`void` `enforceAMF3()` Force using AMF3 everywhere
`protected org.apache.mina.core.buffer.IoBuffer` `getBuffer()` Provide access to raw data.
`Input.RefStorage` `getRefStorage()`
`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
`Vector<Integer>` `readVectorInt()` Read Vector<Integer> object.
`Vector<Double>` `readVectorNumber()` Read Vector<Number> object.
`Vector<Object>` `readVectorObject()` Read Vector
`Vector<Long>` `readVectorUInt()` Read Vector<uint> object.
`Document` `readXML(Type target)` Reads XML
`void` `reset()` Resets map

### Methods inherited from class org.red5.io.amf.Input

`getPropertyType, getString, 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 org.slf4j.Logger log

Logger

### Constructor Detail

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

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

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

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

Read ByteArray object.

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

Specified by:
  `readVectorObject` in interface `Input`
Overrides:
  `readVectorObject` in class `Input`
Returns:
  Vector

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

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

#### reset

    public void reset()

Resets map

Overrides:
  `reset` in class `Input`