ClobUpdatableReader is used to create a Reader capable of
detecting changes to the underlying source.
This class is aware that the underlying stream can be modified and reinitializes itself if it detects any change in the stream. This invalidates the cache so the changes are reflected immediately.
The task of this class is to detect changes in the underlying Clob. Repositioning is handled by other classes.
| Modifier and Type | Field and Description |
|---|---|
| private final EmbedClob | clob
The Clob object we are reading from. |
| private volatile boolean | closed
Tells if this reader has been closed. |
| private InternalClob | iClob
The current internal representation of the Clob content. |
| private long | lastUpdateCount
The last update count seen on the underlying Clob. |
| private final long | maxPos
Position in Clob where to stop reading unless EOF is reached first. |
| private long | pos
Character position of this reader (1-based). |
| private Reader | streamReader
Reader accessing the Clob data and doing the work. |
| Access | Constructor and Description |
|---|---|
| public | ClobUpdatableReader(EmbedClob
source data clob)Creates an updatable reader configured with initial position set to the first character in the Clob and with no imposed length limit. |
| public | ClobUpdatableReader(EmbedClob
source data clob, long the first character that will be read initialPos, long the maximum number of characters that will read length)Creates an updatable reader configured with the specified initial position and with an imposed length limit. |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements abstract java. Implements java. Closes this reader. |
| public int | |
| public int | read(char[]
Destination buffer cbuf, int Offset at which to start storing characters off, int Maximum number of characters to read len)Implements abstract java. Reads characters into a portion of an array. |
| public long | |
| private void |
| clob | back to summary |
|---|---|
| private final EmbedClob clob The Clob object we are reading from. Note that even though the Clob itself is final, the internal representation of the content may change. The reference to the Clob is needed to get a hold of the new internal representation if it is changed.
| |
| closed | back to summary |
|---|---|
| private volatile boolean closed Tells if this reader has been closed. | |
| iClob | back to summary |
|---|---|
| private InternalClob iClob The current internal representation of the Clob content. If the user starts out with a read-only Clob and then modifies it, the internal representation will change. | |
| lastUpdateCount | back to summary |
|---|---|
| private long lastUpdateCount The last update count seen on the underlying Clob. | |
| maxPos | back to summary |
|---|---|
| private final long maxPos Position in Clob where to stop reading unless EOF is reached first. | |
| pos | back to summary |
|---|---|
| private long pos Character position of this reader (1-based). | |
| streamReader | back to summary |
|---|---|
| private Reader streamReader Reader accessing the Clob data and doing the work. | |
| ClobUpdatableReader | back to summary |
|---|---|
| public ClobUpdatableReader(EmbedClob clob) throws IOException, SQLException Creates an updatable reader configured with initial position set to the first character in the Clob and with no imposed length limit.
| |
| ClobUpdatableReader | back to summary |
|---|---|
| public ClobUpdatableReader(EmbedClob clob, long initialPos, long length) throws IOException, SQLException Creates an updatable reader configured with the specified initial position and with an imposed length limit.
| |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements abstract java. Implements java. Closes this reader.
An
| |
| read | back to summary |
|---|---|
| public int read() throws IOException Overrides java. Doc from java. Reads a single character. This method will block until a character is available, an I/O error occurs, or the end of the stream is reached. Subclasses that intend to support efficient single-character input should override this method.
| |
| read | back to summary |
|---|---|
| public int read(char[] cbuf, int off, int len) throws IOException Implements abstract java. Doc from java. Reads characters into a portion of an array. This method will block until some input is available, an I/O error occurs, or the end of the stream is reached. If
| |
| skip | back to summary |
|---|---|
| public long skip(long len) throws IOException Overrides java. Doc from java. Skips characters. This method will block until some characters are available, an I/O error occurs, or the end of the stream is reached. If the stream is already at its end before this method is invoked, then no characters are skipped and zero is returned.
| |
| updateReaderIfRequired | back to summary |
|---|---|
| private void updateReaderIfRequired() throws IOException Updates the reader if the underlying data has been modified. There are two cases to deal with:
| |