|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.esri.arcgis.system.ObjectStream
public class ObjectStream
Specialized kind of IStream for objects.
When implementing your own objects, you will sometimes need to provide support for persistence. For example, with a custom feature renderer, persistence enables its settings to be written to an MXD file so that when ArcMap is restarted, the layer having custom rendering will be drawn in the same way as previously drawn. The COM concept of streams provides a way of reading and writing data to the persisted storage.
The ObjectStream is designed 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.
Constructor Summary | |
---|---|
ObjectStream()
Constructs a ObjectStream using ArcGIS Engine. |
|
ObjectStream(Object obj)
Deprecated. As of ArcGIS 9.2, replaced by normal Java casts. ObjectStream theObjectStream = (ObjectStream) obj; |
Method Summary | |
---|---|
void |
commit(int grfCommitFlags)
commit |
boolean |
equals(Object o)
Compare this object with another |
void |
esri_clone(IStream[] ppstm)
esri_clone |
static String |
getClsid()
getClsid. |
int |
getDocumentVersion()
The version of the document to save. |
IStream |
getStream()
The aggregated stream object. |
String |
getVersion()
The software version for the stream. |
int |
hashCode()
the hashcode for this object |
Object |
loadObject(GUID riid,
Object pUnkOuter)
Load an object from the specified stream. |
void |
lockRegion(_ULARGE_INTEGER libOffset,
_ULARGE_INTEGER cb,
int dwLockType)
lockRegion |
void |
remoteCopyTo(IStream pstm,
_ULARGE_INTEGER cb,
_ULARGE_INTEGER[] pcbRead,
_ULARGE_INTEGER[] pcbWritten)
remoteCopyTo |
void |
remoteRead(byte[] pv,
int cb,
int[] pcbRead)
remoteRead |
void |
remoteSeek(_LARGE_INTEGER dlibMove,
int dwOrigin,
_ULARGE_INTEGER[] plibNewPosition)
remoteSeek |
void |
remoteWrite(byte[] pv,
int cb,
int[] pcbWritten)
remoteWrite |
void |
replaceObject(Object unknown)
Replaces the current object with the object in the the specified stream. |
void |
revert()
revert |
void |
saveObject(Object pUnk)
Store an object to the specified stream. |
void |
setDocumentVersion(int docVersion)
The version of the document to save. |
void |
setSize(_ULARGE_INTEGER libNewSize)
setSize |
void |
setStreamByRef(IStream ppStream)
The aggregated stream object. |
void |
setVersion(String versionSpecifier)
The software version for the stream. |
void |
stat(tagSTATSTG[] pstatstg,
int grfStatFlag)
stat |
void |
unlockRegion(_ULARGE_INTEGER libOffset,
_ULARGE_INTEGER cb,
int dwLockType)
unlockRegion |
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 |
---|
public ObjectStream() throws IOException, UnknownHostException
IOException
- if there are interop problems
UnknownHostException
- if there are interop problemspublic ObjectStream(Object obj) throws IOException
ObjectStream theObjectStream = (ObjectStream) obj;
obj
to ObjectStream
.
obj
- an object returned from ArcGIS Engine or Server
IOException
- if there are interop problemsMethod Detail |
---|
public static String getClsid()
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public void setStreamByRef(IStream ppStream) throws IOException, AutomationException
setStreamByRef
in interface IObjectStream
ppStream
- A reference to a com.esri.arcgis.system.IStream (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public IStream getStream() throws IOException, AutomationException
getStream
in interface IObjectStream
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void saveObject(Object pUnk) throws IOException, AutomationException
saveObject
in interface IObjectStream
pUnk
- A reference to another Object (IUnknown) (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public Object loadObject(GUID riid, Object pUnkOuter) throws IOException, AutomationException
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.
loadObject
in interface IObjectStream
riid
- A Structure: com.esri.arcgis.support.ms.stdole.GUID (in)pUnkOuter
- A reference to another Object (IUnknown) (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void replaceObject(Object unknown) throws IOException, AutomationException
replaceObject
in interface IObjectStream
unknown
- A reference to another Object (IUnknown) (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setVersion(String versionSpecifier) throws IOException, AutomationException
setVersion
in interface IObjectStream
versionSpecifier
- The versionSpecifier (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public String getVersion() throws IOException, AutomationException
getVersion
in interface IObjectStream
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void remoteSeek(_LARGE_INTEGER dlibMove, int dwOrigin, _ULARGE_INTEGER[] plibNewPosition) throws IOException, AutomationException
IStream is a Microsoft interface. Please refer to MSDN for information about this interface.
remoteSeek
in interface IStream
dlibMove
- A Structure: com.esri.arcgis.system._LARGE_INTEGER (in)dwOrigin
- The dwOrigin (in)plibNewPosition
- A Structure: com.esri.arcgis.system._ULARGE_INTEGER (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setSize(_ULARGE_INTEGER libNewSize) throws IOException, AutomationException
IStream is a Microsoft interface. Please refer to MSDN for information about this interface.
setSize
in interface IStream
libNewSize
- A Structure: com.esri.arcgis.system._ULARGE_INTEGER (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void remoteCopyTo(IStream pstm, _ULARGE_INTEGER cb, _ULARGE_INTEGER[] pcbRead, _ULARGE_INTEGER[] pcbWritten) throws IOException, AutomationException
IStream is a Microsoft interface. Please refer to MSDN for information about this interface.
remoteCopyTo
in interface IStream
pstm
- A reference to a com.esri.arcgis.system.IStream (in)cb
- A Structure: com.esri.arcgis.system._ULARGE_INTEGER (in)pcbRead
- A Structure: com.esri.arcgis.system._ULARGE_INTEGER (out: use single element array)pcbWritten
- A Structure: com.esri.arcgis.system._ULARGE_INTEGER (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void commit(int grfCommitFlags) throws IOException, AutomationException
IStream is a Microsoft interface. Please refer to MSDN for information about this interface.
commit
in interface IStream
grfCommitFlags
- The grfCommitFlags (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void revert() throws IOException, AutomationException
IStream is a Microsoft interface. Please refer to MSDN for information about this interface.
revert
in interface IStream
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void lockRegion(_ULARGE_INTEGER libOffset, _ULARGE_INTEGER cb, int dwLockType) throws IOException, AutomationException
IStream is a Microsoft interface. Please refer to MSDN for information about this interface.
lockRegion
in interface IStream
libOffset
- A Structure: com.esri.arcgis.system._ULARGE_INTEGER (in)cb
- A Structure: com.esri.arcgis.system._ULARGE_INTEGER (in)dwLockType
- The dwLockType (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void unlockRegion(_ULARGE_INTEGER libOffset, _ULARGE_INTEGER cb, int dwLockType) throws IOException, AutomationException
IStream is a Microsoft interface. Please refer to MSDN for information about this interface.
unlockRegion
in interface IStream
libOffset
- A Structure: com.esri.arcgis.system._ULARGE_INTEGER (in)cb
- A Structure: com.esri.arcgis.system._ULARGE_INTEGER (in)dwLockType
- The dwLockType (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void stat(tagSTATSTG[] pstatstg, int grfStatFlag) throws IOException, AutomationException
IStream is a Microsoft interface. Please refer to MSDN for information about this interface.
stat
in interface IStream
pstatstg
- A Structure: com.esri.arcgis.system.tagSTATSTG (out: use single element array)grfStatFlag
- The grfStatFlag (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void esri_clone(IStream[] ppstm) throws IOException, AutomationException
esri_clone
in interface IStream
ppstm
- A reference to a com.esri.arcgis.system.IStream (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void remoteRead(byte[] pv, int cb, int[] pcbRead) throws IOException, AutomationException
ISequentialStream is a Microsoft interface. Please refer to MSDN for information about this interface.
remoteRead
in interface ISequentialStream
pv
- An unsigned byte (out: use single element array)cb
- The cb (in)pcbRead
- The pcbRead (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void remoteWrite(byte[] pv, int cb, int[] pcbWritten) throws IOException, AutomationException
ISequentialStream is a Microsoft interface. Please refer to MSDN for information about this interface.
remoteWrite
in interface ISequentialStream
pv
- An unsigned byte (in)cb
- The cb (in)pcbWritten
- The pcbWritten (out: use single element array)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public void setDocumentVersion(int docVersion) throws IOException, AutomationException
setDocumentVersion
in interface IDocumentVersion
docVersion
- A com.esri.arcgis.system.esriArcGISVersion constant (in)
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.public int getDocumentVersion() throws IOException, AutomationException
Determines which version an object is persisted. This can be useful when saving an object ObjectStream or MemoryBlobStream and you want the version of that object to be compatible with previous releases of ArcGIS. Not all persistable objects implement IDocumentVersion; you should ensure the object supports this interface before accessing this property.
getDocumentVersion
in interface IDocumentVersion
IOException
- If there are interop problems.
AutomationException
- If the ArcObject component throws an exception.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |