com.esri.arcgis.system
Class MemoryBlobStream

java.lang.Object
  extended by com.esri.arcgis.system.MemoryBlobStream
All Implemented Interfaces:
com.esri.arcgis.interop.RemoteObjRef, IBlobStream, IDocumentVersion, IMemoryBlobStream, IMemoryBlobStream2, IMemoryBlobStreamVariant, ISequentialStream, IStream, ISupportErrorInfo, Serializable

public class MemoryBlobStream
extends Object
implements com.esri.arcgis.interop.RemoteObjRef, IMemoryBlobStream, IMemoryBlobStream2, IMemoryBlobStreamVariant, IDocumentVersion, ISupportErrorInfo

Memory blob stream object.

Description

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.

A memory blob stream provides storage for binary data in memory.

Remarks

MemoryBlobStreams are particularly useful for writing arbitrary data to databases. When writing objects to the database, you should cocreate an ObjectStream and use that in conjunction with your MemoryBlobStream.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

See Also:
Serialized Form

Constructor Summary
MemoryBlobStream()
          Constructs a MemoryBlobStream using ArcGIS Engine.
MemoryBlobStream(Object obj)
          Deprecated. As of ArcGIS 9.2, replaced by normal Java casts.
MemoryBlobStream theMemoryBlobStream = (MemoryBlobStream) obj;
 
Method Summary
 void attachToMemory(byte[] blobMemory, int size, int transferOwnership)
          Attaches the stream to memory.
 void commit(int grfCommitFlags)
          commit
 boolean equals(Object o)
          Compare this object with another
 void esri_clone(IStream[] ppstm)
          esri_clone
 void exportToVariant(Object[] value)
          Copies the memory to a variant that contains an array of bytes.
 int getAllocSize()
          The allocated size of the stream.
static String getClsid()
          getClsid.
 int getDocumentVersion()
          The version of the document to save.
 void getMemory(byte[] blobMemory, int[] size)
          The memory of the blob stream.
 int getPaddingSize()
          The allocated size of the stream.
 int getSize()
          The size of the stream.
 int hashCode()
          the hashcode for this object
 void importFromMemory(byte[] blobMemory, int size)
          Import using another blob.
 void importFromVariant(Object value)
          Imports from the array of bytes in the variant.
 void interfaceSupportsErrorInfo(GUID riid)
          interfaceSupportsErrorInfo
 void loadFromFile(String fileName)
          Loads a stream from the specified file.
 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 revert()
          revert
 void saveToFile(String fileName)
          Saves the stream to the specified file.
 void setAllocSize(int size)
          The allocated size of the stream.
 void setDocumentVersion(int docVersion)
          The version of the document to save.
 void setPaddingSize(int size)
          The allocated size of the stream.
 void setSize(_ULARGE_INTEGER libNewSize)
          setSize
 void setSize(int size)
          The size of 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

MemoryBlobStream

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

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

MemoryBlobStream

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

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

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

attachToMemory

public void attachToMemory(byte[] blobMemory,
                           int size,
                           int transferOwnership)
                    throws IOException,
                           AutomationException
Attaches the stream to memory. If transferOwnership is true, memory must be allocated with HeapAlloc() using GetProcessHeap().

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
attachToMemory in interface IMemoryBlobStream
Parameters:
blobMemory - An unsigned byte (in)
size - The size (in)
transferOwnership - The transferOwnership (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

importFromMemory

public void importFromMemory(byte[] blobMemory,
                             int size)
                      throws IOException,
                             AutomationException
Import using another blob.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
importFromMemory in interface IMemoryBlobStream
Parameters:
blobMemory - An unsigned byte (in)
size - The size (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getMemory

public void getMemory(byte[] blobMemory,
                      int[] size)
               throws IOException,
                      AutomationException
The memory of the blob stream.

Product Availability

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

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

getSize

public int getSize()
            throws IOException,
                   AutomationException
The size of the stream.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getSize in interface IBlobStream
Returns:
The size
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSize

public void setSize(int size)
             throws IOException,
                    AutomationException
The size of the stream.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

saveToFile

public void saveToFile(String fileName)
                throws IOException,
                       AutomationException
Saves the stream to the specified file.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

loadFromFile

public void loadFromFile(String fileName)
                  throws IOException,
                         AutomationException
Loads a stream from the specified file.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

remoteSeek

public void remoteSeek(_LARGE_INTEGER dlibMove,
                       int dwOrigin,
                       _ULARGE_INTEGER[] plibNewPosition)
                throws IOException,
                       AutomationException
remoteSeek

Description

IStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
remoteSeek in interface IStream
Parameters:
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)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setSize

public void setSize(_ULARGE_INTEGER libNewSize)
             throws IOException,
                    AutomationException
setSize

Description

IStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
setSize in interface IStream
Parameters:
libNewSize - A Structure: com.esri.arcgis.system._ULARGE_INTEGER (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

remoteCopyTo

public void remoteCopyTo(IStream pstm,
                         _ULARGE_INTEGER cb,
                         _ULARGE_INTEGER[] pcbRead,
                         _ULARGE_INTEGER[] pcbWritten)
                  throws IOException,
                         AutomationException
remoteCopyTo

Description

IStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
remoteCopyTo in interface IStream
Parameters:
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)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

commit

public void commit(int grfCommitFlags)
            throws IOException,
                   AutomationException
commit

Description

IStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

revert

public void revert()
            throws IOException,
                   AutomationException
revert

Description

IStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

lockRegion

public void lockRegion(_ULARGE_INTEGER libOffset,
                       _ULARGE_INTEGER cb,
                       int dwLockType)
                throws IOException,
                       AutomationException
lockRegion

Description

IStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
lockRegion in interface IStream
Parameters:
libOffset - A Structure: com.esri.arcgis.system._ULARGE_INTEGER (in)
cb - A Structure: com.esri.arcgis.system._ULARGE_INTEGER (in)
dwLockType - The dwLockType (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

unlockRegion

public void unlockRegion(_ULARGE_INTEGER libOffset,
                         _ULARGE_INTEGER cb,
                         int dwLockType)
                  throws IOException,
                         AutomationException
unlockRegion

Description

IStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
unlockRegion in interface IStream
Parameters:
libOffset - A Structure: com.esri.arcgis.system._ULARGE_INTEGER (in)
cb - A Structure: com.esri.arcgis.system._ULARGE_INTEGER (in)
dwLockType - The dwLockType (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

stat

public void stat(tagSTATSTG[] pstatstg,
                 int grfStatFlag)
          throws IOException,
                 AutomationException
stat

Description

IStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
stat in interface IStream
Parameters:
pstatstg - A Structure: com.esri.arcgis.system.tagSTATSTG (out: use single element array)
grfStatFlag - The grfStatFlag (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

esri_clone

public void esri_clone(IStream[] ppstm)
                throws IOException,
                       AutomationException
esri_clone

Product Availability

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

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

remoteRead

public void remoteRead(byte[] pv,
                       int cb,
                       int[] pcbRead)
                throws IOException,
                       AutomationException
remoteRead

Description

ISequentialStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
remoteRead in interface ISequentialStream
Parameters:
pv - An unsigned byte (out: use single element array)
cb - The cb (in)
pcbRead - The pcbRead (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

remoteWrite

public void remoteWrite(byte[] pv,
                        int cb,
                        int[] pcbWritten)
                 throws IOException,
                        AutomationException
remoteWrite

Description

ISequentialStream is a Microsoft interface. Please refer to MSDN for information about this interface.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
remoteWrite in interface ISequentialStream
Parameters:
pv - An unsigned byte (in)
cb - The cb (in)
pcbWritten - The pcbWritten (out: use single element array)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getAllocSize

public int getAllocSize()
                 throws IOException,
                        AutomationException
The allocated size of the stream.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getAllocSize in interface IMemoryBlobStream2
Returns:
The size
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setAllocSize

public void setAllocSize(int size)
                  throws IOException,
                         AutomationException
The allocated size of the stream.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

getPaddingSize

public int getPaddingSize()
                   throws IOException,
                          AutomationException
The allocated size of the stream.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

Specified by:
getPaddingSize in interface IMemoryBlobStream2
Returns:
The size
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setPaddingSize

public void setPaddingSize(int size)
                    throws IOException,
                           AutomationException
The allocated size of the stream.

Product Availability

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

Supported Platforms

Windows, Solaris, Linux

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

exportToVariant

public void exportToVariant(Object[] value)
                     throws IOException,
                            AutomationException
Copies the memory to a variant that contains an array of bytes.

Product Availability

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

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

importFromVariant

public void importFromVariant(Object value)
                       throws IOException,
                              AutomationException
Imports from the array of bytes in the variant.

Product Availability

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

Specified by:
importFromVariant in interface IMemoryBlobStreamVariant
Parameters:
value - A Variant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

setDocumentVersion

public void setDocumentVersion(int docVersion)
                        throws IOException,
                               AutomationException
The version of the document to save.

Product Availability

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

Specified by:
setDocumentVersion in interface IDocumentVersion
Parameters:
docVersion - A com.esri.arcgis.system.esriArcGISVersion constant (in)
Throws:
IOException - If there are interop problems.
AutomationException - If the ArcObject component throws an exception.

getDocumentVersion

public int getDocumentVersion()
                       throws IOException,
                              AutomationException
The version of the document to save.

Remarks

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.

Product Availability

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

Specified by:
getDocumentVersion in interface IDocumentVersion
Returns:
A com.esri.arcgis.system.esriArcGISVersion constant
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.