Package 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
AMF3 output writer
- Author:
- The Red5 Project, Joachim Bauch ([email protected]), Harald Radi ([email protected])
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate intSet to a value above 0 to disable writing of the AMF3 object tag.protected static org.slf4j.Loggerprivate ConcurrentMap<String,Integer> List of strings already written.Fields inherited from class org.red5.io.object.BaseOutput
refId, refMap -
Constructor Summary
ConstructorsConstructorDescriptionOutput(org.apache.mina.core.buffer.IoBuffer buf) Constructor of AMF3 output. -
Method Summary
Modifier and TypeMethodDescriptionprotected static byte[]encodeString(String string) voidForce using AMF3 everywhereprotected org.apache.mina.core.buffer.IoBufferProvide access to raw data.protected voidputInteger(long value) voidprotected voidprotected voidprotected voidwriteArbitraryObject(Object object) Writes an arbitrary object to the output.voidwriteArray(Object array) Write primitive array.voidwriteArray(Object[] array) Write array.voidwriteArray(Collection<?> array) Write array.voidwriteBoolean(Boolean bol) Write booleanvoidwriteByteArray(ByteArray array) Write ByteArray object (AMF3 only).voidWrite datevoidwriteMap(Collection<?> array) Write array as map.voidWrite map.voidvoidwriteNumber(Number num) Write numbervoidwriteObject(Object object) Write object.voidwriteObject(Map<Object, Object> map) Write map as object.private voidUse the general ARRAY type, writing the primitive array as an array of objects (the boxed primitives) instead.private voidwritePrimitiveByteArray(byte[] bytes) Use the specialized BYTEARRAY type.voidwriteRecordSet(RecordSet recordset) Write recordset.voidwriteString(String string) Write stringvoidwriteVectorInt(Vector<Integer> vector) Write a Vector<int>.voidwriteVectorNumber(Vector<Double> vector) Write a Vector<Number>.voidwriteVectorObject(Vector<Object> vector) Write a Vector<Object>.voidwriteVectorUInt(Vector<Long> vector) Write a Vector<uint>.voidWrite XML objectMethods inherited from class org.red5.io.amf.Output
buf, checkWriteReference, getField, getGetter, isCustom, putString, reset, writeCustom, writeReference, writeXMLMethods inherited from class org.red5.io.object.BaseOutput
clearReferences, getReferenceId, hasReference, storeReferenceMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.red5.io.object.Output
clearReferences, isCustom, writeCustom, writeReference
-
Field Details
-
log
protected static org.slf4j.Logger log -
amf3_mode
private int amf3_modeSet to a value above 0 to disable writing of the AMF3 object tag. -
stringReferences
List of strings already written.
-
-
Constructor Details
-
Output
public Output(org.apache.mina.core.buffer.IoBuffer buf) Constructor of AMF3 output.- Parameters:
buf- instance of IoBuffer- See Also:
-
IoBuffer
-
-
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
-
writeAMF3
protected void writeAMF3() -
writeBoolean
Write boolean- Specified by:
writeBooleanin interfaceOutput- Overrides:
writeBooleanin classOutput- Parameters:
bol- Boolean
-
writeNull
public void writeNull() -
putInteger
protected void putInteger(long value) -
encodeString
-
putString
-
putString
-
writeNumber
Write number- Specified by:
writeNumberin interfaceOutput- Overrides:
writeNumberin classOutput- Parameters:
num- Number
-
writeString
Write string- Specified by:
writeStringin interfaceOutput- Overrides:
writeStringin classOutput- Parameters:
string- String
-
writeDate
Write date -
writeArray
Write array.- Specified by:
writeArrayin interfaceOutput- Overrides:
writeArrayin classOutput- Parameters:
array- Array to write
-
writeArray
Write array.- Specified by:
writeArrayin interfaceOutput- Overrides:
writeArrayin classOutput- Parameters:
array- Array to write
-
writeArray
Write primitive array.- Specified by:
writeArrayin interfaceOutput- Overrides:
writeArrayin classOutput- Parameters:
array- Array to write
-
writePrimitiveByteArray
private void writePrimitiveByteArray(byte[] bytes) Use the specialized BYTEARRAY type. -
writePrimitiveArrayFallback
Use the general ARRAY type, writing the primitive array as an array of objects (the boxed primitives) instead. -
writeMap
Write map. -
writeMap
Write array as map. -
writeArbitraryObject
Writes an arbitrary object to the output.- Overrides:
writeArbitraryObjectin classOutput- Parameters:
object- Object to write
-
writeObject
Write object.- Specified by:
writeObjectin interfaceOutput- Overrides:
writeObjectin classOutput- Parameters:
object- Object to write
-
writeObject
Write map as object.- Specified by:
writeObjectin interfaceOutput- Overrides:
writeObjectin classOutput- Parameters:
map- Map to write
-
writeRecordSet
Write recordset.- Specified by:
writeRecordSetin interfaceOutput- Overrides:
writeRecordSetin classOutput- Parameters:
recordset- Recordset to write
-
writeXML
Write XML object -
writeByteArray
Write ByteArray object (AMF3 only).- Specified by:
writeByteArrayin interfaceOutput- Overrides:
writeByteArrayin classOutput- Parameters:
array- object to write
-
writeVectorInt
Write a Vector<int>.- Specified by:
writeVectorIntin interfaceOutput- Overrides:
writeVectorIntin classOutput- Parameters:
vector- vector
-
writeVectorUInt
Write a Vector<uint>.- Specified by:
writeVectorUIntin interfaceOutput- Overrides:
writeVectorUIntin classOutput- Parameters:
vector- vector
-
writeVectorNumber
Write a Vector<Number>.- Specified by:
writeVectorNumberin interfaceOutput- Overrides:
writeVectorNumberin classOutput- Parameters:
vector- vector
-
writeVectorObject
Write a Vector<Object>.- Specified by:
writeVectorObjectin interfaceOutput- Overrides:
writeVectorObjectin classOutput- Parameters:
vector- vector
-