com.esri.arcgis.system
Class AMFWriter

java.lang.Object
  extended by com.esri.arcgis.system.AMFWriter
All Implemented Interfaces:
com.esri.arcgis.interop.RemoteObjRef, IAMFWriter, ISupportErrorInfo, Serializable

public class AMFWriter
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IAMFWriter, ISupportErrorInfo

A sequential AMF Writer.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

See Also:
Serialized Form

Constructor Summary
AMFWriter()
          Constructs a AMFWriter using ArcGIS Engine.
AMFWriter(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
AMFWriter theAMFWriter = (AMFWriter) obj;
 
Method Summary
 void endAMF3Array()
          Finishes writing an array.
 void endAMF3Object()
          Finishes writing object.
 void endAMF3ObjectTraits()
          Call this method to finish writing object traits and switch to writing members.
 boolean equals(Object o)
          Compare this object with another
static String getClsid()
          getClsid.
 void getCopy(IAMFWriter[] ppOutWriter)
          Clones IAMFWriter.
 IStream getStream()
          Obtains underlying stream.
 int hashCode()
          the hashcode for this object
 void interfaceSupportsErrorInfo(GUID riid)
          interfaceSupportsErrorInfo
 void startAMF3Array(int denseCount, int[] obj_ref)
          Starts writing of array.
 void startAMF3CustomObject(String classname, int[] obj_ref)
          Starst writing a custom object.
 void startAMF3Object(int traits_ref, int[] obj_ref)
          Starts writing an object, sends traits by reference.
 void startAMF3ObjectWithTraits(String classname, int memberCount, boolean dynamic, int[] traits_ref, int[] obj_ref)
          Start writing an object with traits.
 void writeAMF3_UTF8(String value, int[] string_ref)
          This method is required if you want to write member names in traits.
 void writeAMF3_UTF8Ref(int string_ref)
          This method is required if you want to write member names in traits by reference.
 void writeAMF3ArrayDenseMarker()
          Switches from writing of associative portion of an array to dense portion.
 void writeAMF3ArrayRef(int obj_ref)
          Writes an array by reference.
 void writeAMF3Bool(boolean value)
          Writes boolean value.
 void writeAMF3ByteArray(byte[] ppArray, int[] obj_ref)
          Writes byte array.
 void writeAMF3ByteArrayRef(int obj_ref)
          Writes byte array by reference.
 void writeAMF3Date(Date value, boolean asJsonNumber, int[] obj_ref)
          Writes date.
 void writeAMF3DateRef(int obj_ref)
          Writes date by reference.
 void writeAMF3Double(double value)
          Writes double (64-bit) value.
 void writeAMF3Int(int value)
          Writes integer (32-bit) value.
 void writeAMF3Null()
          Writes null value.
 void writeAMF3ObjectRef(int obj_ref)
          Writes object by reference.
 void writeAMF3String(String value, int[] string_ref)
          Writes string value.
 void writeAMF3StringRef(int string_ref)
          Writes string value by reference.
 void writeAMF3Undefined()
          Writes undefined value.
 void writeAMF3Variant(Object value, int[] value_ref)
          Writes value types (excluding array and object), may return string or object reference index.
 void writeAMF3Xml(String value, int[] obj_ref)
          Writes XML.
 void writeAMF3XmlDoc(String value, int[] obj_ref)
          Writes XML document.
 void writeAMF3XmlDocRef(int obj_ref)
          Writes XML document by reference.
 void writeAMF3XmlRef(int obj_ref)
          Writes XML by reference.
 void writeTo(IStream outputStream)
          Specifies output AMF stream.
 void writeU16(short b)
          Writes short integer.
 void writeU32(int b)
          Writes an integer.
 void writeU8(byte b)
          Writes a byte.
 void writeUTF8(String value)
          This method is used to write AMF0 strings.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface com.esri.arcgis.interop.RemoteObjRef
getJintegraDispatch, release
 

Constructor Detail

AMFWriter

public AMFWriter()
          throws IOException,
                 UnknownHostException
Constructs a AMFWriter using ArcGIS Engine.

Throws:
IOException - if there are interop problems
UnknownHostException - if there are interop problems

AMFWriter

public AMFWriter(Object obj)
          throws IOException
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
AMFWriter theAMFWriter = (AMFWriter) obj;

Construct a AMFWriter using a reference to such an object returned from ArcGIS Engine or Server. This is semantically equivalent to casting obj to AMFWriter.

Parameters:
obj - an object returned from ArcGIS Engine or Server
Throws:
IOException - if there are interop problems
Method Detail

getClsid

public static String getClsid()
getClsid.


equals

public boolean equals(Object o)
Compare this object with another

Overrides:
equals in class Object

hashCode

public int hashCode()
the hashcode for this object

Overrides:
hashCode in class Object

writeTo

public void writeTo(IStream outputStream)
             throws IOException,
                    AutomationException
Specifies output AMF stream.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeTo in interface IAMFWriter
Parameters:
outputStream - A reference to a com.esri.arcgis.system.IStream (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getStream

public IStream getStream()
                  throws IOException,
                         AutomationException
Obtains underlying stream.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getStream in interface IAMFWriter
Returns:
A reference to a com.esri.arcgis.system.IStream
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeAMF3Undefined

public void writeAMF3Undefined()
                        throws IOException,
                               AutomationException
Writes undefined value.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeAMF3Undefined in interface IAMFWriter
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeAMF3Null

public void writeAMF3Null()
                   throws IOException,
                          AutomationException
Writes null value.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeAMF3Null in interface IAMFWriter
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeAMF3Bool

public void writeAMF3Bool(boolean value)
                   throws IOException,
                          AutomationException
Writes boolean value.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeAMF3Bool in interface IAMFWriter
Parameters:
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeAMF3Int

public void writeAMF3Int(int value)
                  throws IOException,
                         AutomationException
Writes integer (32-bit) value.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeAMF3Int in interface IAMFWriter
Parameters:
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeAMF3Double

public void writeAMF3Double(double value)
                     throws IOException,
                            AutomationException
Writes double (64-bit) value.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeAMF3Double in interface IAMFWriter
Parameters:
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeAMF3String

public void writeAMF3String(String value,
                            int[] string_ref)
                     throws IOException,
                            AutomationException
Writes string value. Returns string reference index.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeAMF3String in interface IAMFWriter
Parameters:
value - The value (in)
string_ref - The string_ref (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeAMF3StringRef

public void writeAMF3StringRef(int string_ref)
                        throws IOException,
                               AutomationException
Writes string value by reference.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeAMF3StringRef in interface IAMFWriter
Parameters:
string_ref - The string_ref (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeAMF3XmlDoc

public void writeAMF3XmlDoc(String value,
                            int[] obj_ref)
                     throws IOException,
                            AutomationException
Writes XML document. Returns object reference index.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeAMF3XmlDoc in interface IAMFWriter
Parameters:
value - The value (in)
obj_ref - The obj_ref (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeAMF3XmlDocRef

public void writeAMF3XmlDocRef(int obj_ref)
                        throws IOException,
                               AutomationException
Writes XML document by reference.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeAMF3XmlDocRef in interface IAMFWriter
Parameters:
obj_ref - The obj_ref (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeAMF3Xml

public void writeAMF3Xml(String value,
                         int[] obj_ref)
                  throws IOException,
                         AutomationException
Writes XML. Returns object reference index.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeAMF3Xml in interface IAMFWriter
Parameters:
value - The value (in)
obj_ref - The obj_ref (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeAMF3XmlRef

public void writeAMF3XmlRef(int obj_ref)
                     throws IOException,
                            AutomationException
Writes XML by reference.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeAMF3XmlRef in interface IAMFWriter
Parameters:
obj_ref - The obj_ref (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeAMF3Date

public void writeAMF3Date(Date value,
                          boolean asJsonNumber,
                          int[] obj_ref)
                   throws IOException,
                          AutomationException
Writes date. Returns object reference index.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeAMF3Date in interface IAMFWriter
Parameters:
value - The value (in)
asJsonNumber - The asJsonNumber (in)
obj_ref - The obj_ref (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeAMF3DateRef

public void writeAMF3DateRef(int obj_ref)
                      throws IOException,
                             AutomationException
Writes date by reference. Important: do not use this method if you send dates as JSON numbers, references will be incorrect.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeAMF3DateRef in interface IAMFWriter
Parameters:
obj_ref - The obj_ref (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeAMF3ByteArray

public void writeAMF3ByteArray(byte[] ppArray,
                               int[] obj_ref)
                        throws IOException,
                               AutomationException
Writes byte array. Returns object reference index. Note that this is not an AMF3 array but another type - AMF3 byte array.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeAMF3ByteArray in interface IAMFWriter
Parameters:
ppArray - An unsigned byte (in)
obj_ref - The obj_ref (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeAMF3ByteArrayRef

public void writeAMF3ByteArrayRef(int obj_ref)
                           throws IOException,
                                  AutomationException
Writes byte array by reference. Note that this is not an AMF3 array but another type - AMF3 byte array.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeAMF3ByteArrayRef in interface IAMFWriter
Parameters:
obj_ref - The obj_ref (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeAMF3Variant

public void writeAMF3Variant(Object value,
                             int[] value_ref)
                      throws IOException,
                             AutomationException
Writes value types (excluding array and object), may return string or object reference index. If reference is not applicable, value_ref is set to -1.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeAMF3Variant in interface IAMFWriter
Parameters:
value - A Variant (in)
value_ref - The value_ref (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

startAMF3Array

public void startAMF3Array(int denseCount,
                           int[] obj_ref)
                    throws IOException,
                           AutomationException
Starts writing of array. Returns object reference index.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
startAMF3Array in interface IAMFWriter
Parameters:
denseCount - The denseCount (in)
obj_ref - The obj_ref (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeAMF3ArrayDenseMarker

public void writeAMF3ArrayDenseMarker()
                               throws IOException,
                                      AutomationException
Switches from writing of associative portion of an array to dense portion.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeAMF3ArrayDenseMarker in interface IAMFWriter
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

endAMF3Array

public void endAMF3Array()
                  throws IOException,
                         AutomationException
Finishes writing an array.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
endAMF3Array in interface IAMFWriter
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeAMF3ArrayRef

public void writeAMF3ArrayRef(int obj_ref)
                       throws IOException,
                              AutomationException
Writes an array by reference.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeAMF3ArrayRef in interface IAMFWriter
Parameters:
obj_ref - The obj_ref (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

startAMF3CustomObject

public void startAMF3CustomObject(String classname,
                                  int[] obj_ref)
                           throws IOException,
                                  AutomationException
Starst writing a custom object. Contents of this kind of objects are user-defined.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
startAMF3CustomObject in interface IAMFWriter
Parameters:
classname - The classname (in)
obj_ref - The obj_ref (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

startAMF3Object

public void startAMF3Object(int traits_ref,
                            int[] obj_ref)
                     throws IOException,
                            AutomationException
Starts writing an object, sends traits by reference. Returns object reference index.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
startAMF3Object in interface IAMFWriter
Parameters:
traits_ref - The traits_ref (in)
obj_ref - The obj_ref (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

startAMF3ObjectWithTraits

public void startAMF3ObjectWithTraits(String classname,
                                      int memberCount,
                                      boolean dynamic,
                                      int[] traits_ref,
                                      int[] obj_ref)
                               throws IOException,
                                      AutomationException
Start writing an object with traits. Returns trait reference index end object reference index.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
startAMF3ObjectWithTraits in interface IAMFWriter
Parameters:
classname - The classname (in)
memberCount - The memberCount (in)
dynamic - The dynamic (in)
traits_ref - The traits_ref (out: use single element array)
obj_ref - The obj_ref (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

endAMF3ObjectTraits

public void endAMF3ObjectTraits()
                         throws IOException,
                                AutomationException
Call this method to finish writing object traits and switch to writing members.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
endAMF3ObjectTraits in interface IAMFWriter
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

endAMF3Object

public void endAMF3Object()
                   throws IOException,
                          AutomationException
Finishes writing object.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
endAMF3Object in interface IAMFWriter
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeAMF3ObjectRef

public void writeAMF3ObjectRef(int obj_ref)
                        throws IOException,
                               AutomationException
Writes object by reference.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeAMF3ObjectRef in interface IAMFWriter
Parameters:
obj_ref - The obj_ref (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeAMF3_UTF8

public void writeAMF3_UTF8(String value,
                           int[] string_ref)
                    throws IOException,
                           AutomationException
This method is required if you want to write member names in traits.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeAMF3_UTF8 in interface IAMFWriter
Parameters:
value - The value (in)
string_ref - The string_ref (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeAMF3_UTF8Ref

public void writeAMF3_UTF8Ref(int string_ref)
                       throws IOException,
                              AutomationException
This method is required if you want to write member names in traits by reference.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeAMF3_UTF8Ref in interface IAMFWriter
Parameters:
string_ref - The string_ref (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeU8

public void writeU8(byte b)
             throws IOException,
                    AutomationException
Writes a byte. AMF0 format only. Don't use this method for AMF3 objects.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeU8 in interface IAMFWriter
Parameters:
b - An unsigned byte (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeU16

public void writeU16(short b)
              throws IOException,
                     AutomationException
Writes short integer. AMF0 format only. Don't use this method for AMF3 objects.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeU16 in interface IAMFWriter
Parameters:
b - The b (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeU32

public void writeU32(int b)
              throws IOException,
                     AutomationException
Writes an integer. AMF0 format only. Don't use this method for AMF3 objects.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeU32 in interface IAMFWriter
Parameters:
b - The b (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

writeUTF8

public void writeUTF8(String value)
               throws IOException,
                      AutomationException
This method is used to write AMF0 strings. AMF0 format only. Don't use this method for AMF3 objects.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
writeUTF8 in interface IAMFWriter
Parameters:
value - The value (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getCopy

public void getCopy(IAMFWriter[] ppOutWriter)
             throws IOException,
                    AutomationException
Clones IAMFWriter. Useful when you want to preserve traits and object, string and trait references.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Specified by:
getCopy in interface IAMFWriter
Parameters:
ppOutWriter - A reference to a com.esri.arcgis.system.IAMFWriter (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

interfaceSupportsErrorInfo

public void interfaceSupportsErrorInfo(GUID riid)
                                throws IOException,
                                       AutomationException
interfaceSupportsErrorInfo

Description

Indicates whether the interface supports IErrorInfo.

Product Availability

Available with ArcGIS Engine, ArcGIS Desktop, and ArcGIS Server.

Supported Platforms

Windows, Solaris, Linux

Specified by:
interfaceSupportsErrorInfo in interface ISupportErrorInfo
Parameters:
riid - A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.