com.esri.arcgis.system
Interface IObjectStream

All Superinterfaces:
ISequentialStream, IStream, Serializable
All Known Implementing Classes:
ObjectStream

public interface IObjectStream
extends IStream, Serializable

Provides access to members used to make objects and object references persistant. Use of this interface allows multiple references to the same object to be stored properly.

Description

The IObjectStream interface provides properties and methods to allow you to correctly persist collections of ArcObjects objects in which there may be multiple references to a single object. For example if you persist both a Map and a LegendItem to the same stream, both may have references to a single layer. The ObjectStream ensures that the layer is only written to the persistence stream once. If you persist objects without an ObjectStream, you run the risk that the objects will be incorrectly rehydrated.

See the topics on implementing persistence for more details on implementing persistence on your custom objects with IObjectStream.

Product Availability

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


Method Summary
 IStream getStream()
          The aggregated stream object.
 String getVersion()
          The software version for the stream.
 Object loadObject(GUID riid, Object pUnkOuter)
          Load an object from the specified stream.
 void replaceObject(Object unknown)
          Replaces the current object with the object in the the specified stream.
 void saveObject(Object pUnk)
          Store an object to the specified stream.
 void setStreamByRef(IStream ppStream)
          The aggregated stream object.
 void setVersion(String versionSpecifier)
          The software version for the stream.
 
Methods inherited from interface com.esri.arcgis.system.IStream
commit, esri_clone, lockRegion, remoteCopyTo, remoteSeek, revert, setSize, stat, unlockRegion
 
Methods inherited from interface com.esri.arcgis.system.ISequentialStream
remoteRead, remoteWrite
 

Method Detail

setStreamByRef

void setStreamByRef(IStream ppStream)
                    throws IOException,
                           AutomationException
The aggregated stream object.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
ppStream - 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

IStream getStream()
                  throws IOException,
                         AutomationException
The aggregated stream object.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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.

saveObject

void saveObject(Object pUnk)
                throws IOException,
                       AutomationException
Store an object to the specified stream. The first time the object is stored, the full object is written to the stream. When the object is subsequently stored, a reference is stored.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
pUnk - A reference to another Object (IUnknown) (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

loadObject

Object loadObject(GUID riid,
                  Object pUnkOuter)
                  throws IOException,
                         AutomationException
Load an object from the specified stream. The first time an object is encountered, it is loaded from the stream. When subsequent references to the object are loaded, a pointer to the first object is returned.

Remarks

The first parameter of LoadObject is a GUID of an interface ID (most of them could be find under HKEY_CLASSES_ROOT\Interface in the registry), not the object's GUID. The object that gets loaded will QI for this interface and the result is returned with the IUnknown parameter.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
riid - A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)
pUnkOuter - A reference to another Object (IUnknown) (in)
Returns:
A reference to another Object (IUnknown)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

replaceObject

void replaceObject(Object unknown)
                   throws IOException,
                          AutomationException
Replaces the current object with the object in the the specified stream.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
unknown - A reference to another Object (IUnknown) (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setVersion

void setVersion(String versionSpecifier)
                throws IOException,
                       AutomationException
The software version for the stream.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Parameters:
versionSpecifier - The versionSpecifier (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getVersion

String getVersion()
                  throws IOException,
                         AutomationException
The software version for the stream.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Returns:
The versionSpecifier
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.