Class CDOBlob
CDOBlobs are immutable. Once created, their ID and size do not change.
The ID is a digest of the content of the blob, SHA-1 by default (see CDOLobStoreImpl.DEFAULT_DIGEST_ALGORITHM).
CDOBlobs can be created from an InputStream, a byte[], or a hex-encoded String.
On the client side, CDOBlobs are created with a reference to a CDOLobStore, which is used to store and retrieve
the blob's content. On the server side, CDOBlobs are created without a store reference and are always retrieved from
the repository's IStore.
The default CDOLobStore implementation is CDOLobStoreImpl.INSTANCE, which stores blobs in the local file system.
But on the client side, it's often more efficient to use a dedicated CDOLobStore instance that stores blobs in
a CDOSession-specific cache location. See CDOSession.Options.setLobCache(CDOLobStore) for details.
See also CDOSession.newBlob(InputStream) and CDOSession.newBlob(byte[]) for convenient ways to create CDOBlobs.
- Since:
- 4.0
- Author:
- Eike Stepper
-
Field Summary
Fields inherited from class org.eclipse.emf.cdo.common.lob.CDOLob
DEFAULT_STORE -
Constructor Summary
ConstructorsConstructorDescriptionCDOBlob(byte[] contents) CDOBlob(byte[] contents, CDOLobStore store) CDOBlob(InputStream contents) CDOBlob(InputStream contents, CDOLobStore store) CDOBlob(String contentsHexString, CDOLobStore store) -
Method Summary
Modifier and TypeMethodDescriptionvoidcopyTo(OutputStream out) byte[]getBytes()protected CDOLobInfoput(InputStream contents) Methods inherited from class org.eclipse.emf.cdo.common.lob.CDOLob
getByteCount, getStoreMethods inherited from class org.eclipse.emf.cdo.common.lob.CDOLobInfo
equals, getID, getIDString, getSize, hashCode, toString
-
Constructor Details
-
CDOBlob
- Throws:
IOException
-
CDOBlob
- Throws:
IOException
-
CDOBlob
- Throws:
IOException- Since:
- 4.27
-
CDOBlob
- Throws:
IOException- Since:
- 4.13
-
CDOBlob
- Throws:
IOException- Since:
- 4.27
-
CDOBlob
- Throws:
IOException- Since:
- 4.13
-
-
Method Details
-
getStoreFile
- Specified by:
getStoreFilein classCDOLob<InputStream>
-
getContents
- Specified by:
getContentsin classCDOLob<InputStream>- Throws:
IOException
-
getBytes
- Throws:
IOException- Since:
- 4.13
-
getString
- Specified by:
getStringin classCDOLob<InputStream>- Throws:
IOException- Since:
- 4.13
-
copyTo
- Throws:
IOException- Since:
- 4.27
-
put
- Specified by:
putin classCDOLob<InputStream>- Throws:
IOException
-