org.red5.io.amf3

## Class Output

- java.lang.Object
- - org.red5.io.object.BaseOutput
  - - org.red5.io.amf.Output
    - - org.red5.io.amf3.Output

All Implemented Interfaces:
  Output

    public class Output
    extends Output
    implements Output

AMF3 output writer

Author:
  The Red5 Project (red5@osflash.org), Joachim Bauch (jojo@struktur.de), Harald Radi (harald.radi@nme.at)
See Also:
  `AMF3`, `Input`

### Field Summary

Fields
`protected static org.slf4j.Logger` `log`

### Fields inherited from class org.red5.io.amf.Output

`buf`

### Fields inherited from class org.red5.io.object.BaseOutput

`refId, refMap`

### Constructor Summary

Constructors
Constructor and Description
`Output(org.apache.mina.core.buffer.IoBuffer buf)` Constructor of AMF3 output.

### Method Summary

Methods
`protected static byte[]` `encodeString(String string)`
`void` `enforceAMF3()` Force using AMF3 everywhere
`protected org.apache.mina.core.buffer.IoBuffer` `getBuffer()` Provide access to raw data.
`protected void` `putInteger(long value)`
`void` `putString(String string)`
`protected void` `putString(String str, byte[] encoded)`
`boolean` `supportsDataType(byte type)`
`protected void` `writeAMF3()`
`protected void` `writeArbitraryObject(Object object, Serializer serializer)` Writes an arbitrary object to the output.
`void` `writeArray(Collection<?> array, Serializer serializer)` Write array.
`void` `writeArray(Object[] array, Serializer serializer)` Write array.
`void` `writeArray(Object array, Serializer serializer)` Write primitive array.
`void` `writeBoolean(Boolean bol)` Write boolean
`void` `writeByteArray(ByteArray array)` Write ByteArray object (AMF3 only).
`void` `writeDate(Date date)` Write date
`void` `writeMap(Collection<?> array, Serializer serializer)` Write array as map.
`void` `writeMap(Map<Object,Object> map, Serializer serializer)` Write map.
`void` `writeNull()`
`void` `writeNumber(Number num)` Write number
`void` `writeObject(Map<Object,Object> map, Serializer serializer)` Write map as object.
`void` `writeObject(Object object, Serializer serializer)` Write object.
`void` `writeRecordSet(RecordSet recordset, Serializer serializer)` Write recordset.
`void` `writeString(String string)` Write string
`void` `writeVectorInt(Vector<Integer> vector)` Write a Vector<int>.
`void` `writeVectorNumber(Vector<Double> vector)` Write a Vector<Number>.
`void` `writeVectorObject(Vector<Object> vector)` Write a Vector
`void` `writeVectorUInt(Vector<Long> vector)` Write a Vector<uint>.
`void` `writeXML(Document xml)` Write XML object

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

`buf, checkWriteReference, destroyCache, getField, getFieldCache, getGetter, getGetterCache, getSerializeCache, getStringCache, isCustom, putString, reset, serializeField, writeCustom, writeReference, writeXML`

### Methods inherited from class org.red5.io.object.BaseOutput

`clearReferences, getReferenceId, hasReference, 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.Output

`clearReferences, isCustom, writeCustom, writeReference`

### Field Detail

#### log

    protected static org.slf4j.Logger log

### Constructor Detail

#### Output

    public Output(org.apache.mina.core.buffer.IoBuffer buf)

Constructor of AMF3 output.

Parameters:
  `buf` - instance of IoBuffer
See Also:
  `IoBuffer`

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

#### supportsDataType

    public boolean supportsDataType(byte type)

Specified by:
  `supportsDataType` in interface `Output`
Overrides:
  `supportsDataType` in class `Output`

#### writeAMF3

    protected void writeAMF3()

#### writeBoolean

    public void writeBoolean(Boolean bol)

Write boolean

Specified by:
  `writeBoolean` in interface `Output`
Overrides:
  `writeBoolean` in class `Output`
Parameters:
  `bol` - Boolean

#### writeNull

    public void writeNull()

Specified by:
  `writeNull` in interface `Output`
Overrides:
  `writeNull` in class `Output`

#### putInteger

    protected void putInteger(long value)

#### encodeString

    protected static byte[] encodeString(String string)

#### putString

    protected void putString(String str,
                 byte[] encoded)

#### putString

    public void putString(String string)

Specified by:
  `putString` in interface `Output`
Overrides:
  `putString` in class `Output`

#### writeNumber

    public void writeNumber(Number num)

Write number

Specified by:
  `writeNumber` in interface `Output`
Overrides:
  `writeNumber` in class `Output`
Parameters:
  `num` - Number

#### writeString

    public void writeString(String string)

Write string

Specified by:
  `writeString` in interface `Output`
Overrides:
  `writeString` in class `Output`
Parameters:
  `string` - String

#### writeDate

    public void writeDate(Date date)

Write date

Specified by:
  `writeDate` in interface `Output`
Overrides:
  `writeDate` in class `Output`
Parameters:
  `date` - Date

#### writeArray

    public void writeArray(Collection<?> array,
                  Serializer serializer)

Write array.

Specified by:
  `writeArray` in interface `Output`
Overrides:
  `writeArray` in class `Output`
Parameters:
  `array` - Array to write.
  `serializer` - Serializer to use for subobjects.

#### writeArray

    public void writeArray(Object[] array,
                  Serializer serializer)

Write array.

Specified by:
  `writeArray` in interface `Output`
Overrides:
  `writeArray` in class `Output`
Parameters:
  `array` - Array to write.
  `serializer` - Serializer to use for subobjects.

#### writeArray

    public void writeArray(Object array,
                  Serializer serializer)

Write primitive array.

Specified by:
  `writeArray` in interface `Output`
Overrides:
  `writeArray` in class `Output`
Parameters:
  `array` - Array to write.
  `serializer` - Serializer to use for subobjects.

#### writeMap

    public void writeMap(Map<Object,Object> map,
                Serializer serializer)

Write map.

Specified by:
  `writeMap` in interface `Output`
Overrides:
  `writeMap` in class `Output`
Parameters:
  `map` - Map to write
  `serializer` - Serializer to use for subobjects.

#### writeMap

    public void writeMap(Collection<?> array,
                Serializer serializer)

Write array as map.

Specified by:
  `writeMap` in interface `Output`
Overrides:
  `writeMap` in class `Output`
Parameters:
  `array` - Array to write
  `serializer` - Serializer to use for subobjects.

#### writeArbitraryObject

    protected void writeArbitraryObject(Object object,
                            Serializer serializer)

Writes an arbitrary object to the output.

Overrides:
  `writeArbitraryObject` in class `Output`
Parameters:
  `object` - Object to write
  `serializer` - Output writer

#### writeObject

    public void writeObject(Object object,
                   Serializer serializer)

Write object.

Specified by:
  `writeObject` in interface `Output`
Overrides:
  `writeObject` in class `Output`
Parameters:
  `object` - Object to write
  `serializer` - Serializer to use for subobjects.

#### writeObject

    public void writeObject(Map<Object,Object> map,
                   Serializer serializer)

Write map as object.

Specified by:
  `writeObject` in interface `Output`
Overrides:
  `writeObject` in class `Output`
Parameters:
  `map` - Map to write
  `serializer` - Serializer to use for subobjects.

#### writeRecordSet

    public void writeRecordSet(RecordSet recordset,
                      Serializer serializer)

Write recordset.

Specified by:
  `writeRecordSet` in interface `Output`
Overrides:
  `writeRecordSet` in class `Output`
Parameters:
  `recordset` - Recordset to write.
  `serializer` - Serializer to use for subobjects.

#### writeXML

    public void writeXML(Document xml)

Write XML object

Specified by:
  `writeXML` in interface `Output`
Overrides:
  `writeXML` in class `Output`
Parameters:
  `xml` - XML document

#### writeByteArray

    public void writeByteArray(ByteArray array)

Write ByteArray object (AMF3 only).

Specified by:
  `writeByteArray` in interface `Output`
Overrides:
  `writeByteArray` in class `Output`
Parameters:
  `array` - object to write

#### writeVectorInt

    public void writeVectorInt(Vector<Integer> vector)

Write a Vector<int>.

Specified by:
  `writeVectorInt` in interface `Output`
Overrides:
  `writeVectorInt` in class `Output`
Parameters:
  `vector` -

#### writeVectorUInt

    public void writeVectorUInt(Vector<Long> vector)

Write a Vector<uint>.

Specified by:
  `writeVectorUInt` in interface `Output`
Overrides:
  `writeVectorUInt` in class `Output`
Parameters:
  `vector` -

#### writeVectorNumber

    public void writeVectorNumber(Vector<Double> vector)

Write a Vector<Number>.

Specified by:
  `writeVectorNumber` in interface `Output`
Overrides:
  `writeVectorNumber` in class `Output`
Parameters:
  `vector` -

#### writeVectorObject

    public void writeVectorObject(Vector<Object> vector)

Write a Vector

Specified by:
  `writeVectorObject` in interface `Output`
Overrides:
  `writeVectorObject` in class `Output`
Parameters:
  `vector` -