Package org.eclipse.emf.cdo.common.lob

# Class CDOClob

java.lang.Object
org.eclipse.emf.cdo.common.lob.CDOLobInfo
org.eclipse.emf.cdo.common.lob.CDOLob<Reader>
org.eclipse.emf.cdo.common.lob.CDOClob

public final class CDOClob extends CDOLob<Reader>
An identifiable character large object with streaming support.

CDOClobs are immutable. Once created, their `ID` and `size` do not change. The ID is a digest of the content of the clob, SHA-1 by default (see `CDOLobStoreImpl.DEFAULT_DIGEST_ALGORITHM`).

CDOClobs can be created from a `Reader`, or a `String`. On the client side, CDOClobs are created with a reference to a `CDOLobStore`, which is used to store and retrieve the clob's content. On the server side, CDOClobs are created without a store reference and are always retrieved from the repository's `IStore`.

The default `CDOLobStore` implementation is `CDOLobStoreImpl.INSTANCE`, which stores clobs in the local file system. But on the client side, it's often more efficient to use a dedicated `CDOLobStore` instance that stores clobs in a `CDOSession`-specific cache location. See `CDOSession.Options.setLobCache(CDOLobStore)` for details. See also `CDOSession.newClob(Reader)` and `CDOSession.newClob(String)` for convenient ways to create CDOClobs.

Since:
  4.0
Author:
  Eike Stepper

## Field Summary

### Fields inherited from class org.eclipse.emf.cdo.common.lob.CDOLob

`DEFAULT_STORE`

## Constructor Summary

Constructors
Constructor
Description
`CDOClob(Reader contents)`
`CDOClob(Reader contents, CDOLobStore store)`
`CDOClob(String contents)`
`CDOClob(String contents, CDOLobStore store)`

## Method Summary

Modifier and Type
Method
Description
`void`
`copyTo(Writer writer)`
`Reader`
`getContents()`
`File`
`getStoreFile()`
`String`
`getString()`
`protected CDOLobInfo`
`put(Reader contents)`

### Methods inherited from class org.eclipse.emf.cdo.common.lob.CDOLob

`getByteCount, getStore`

### Methods inherited from class org.eclipse.emf.cdo.common.lob.CDOLobInfo

`equals, getID, getIDString, getSize, hashCode, toString`

### Methods inherited from class java.lang.Object

`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

## Constructor Details

### CDOClob

public CDOClob(Reader contents) throws IOException

Throws:
  `IOException`

### CDOClob

public CDOClob(Reader contents, CDOLobStore store) throws IOException

Throws:
  `IOException`

### CDOClob

public CDOClob(String contents) throws IOException

Throws:
  `IOException`
Since:
  4.27

### CDOClob

public CDOClob(String contents, CDOLobStore store) throws IOException

Throws:
  `IOException`
Since:
  4.13

## Method Details

### getStoreFile

public File getStoreFile()

Specified by:
  `getStoreFile` in class `CDOLob<Reader>`

### getContents

public Reader getContents() throws IOException

Specified by:
  `getContents` in class `CDOLob<Reader>`
Throws:
  `IOException`

### getString

public String getString() throws IOException

Specified by:
  `getString` in class `CDOLob<Reader>`
Throws:
  `IOException`
Since:
  4.13

### copyTo

public void copyTo(Writer writer) throws IOException

Throws:
  `IOException`
Since:
  4.27

### put

protected CDOLobInfo put(Reader contents) throws IOException

Specified by:
  `put` in class `CDOLob<Reader>`
Throws:
  `IOException`