Note that the streams from the store are expected to have the following properties:
0xe0 0x00 0x00
| Modifier and Type | Field and Description |
|---|---|
| private final ConnectionChild | conChild
The connection (child) this Clob belongs to. |
| private CharacterStreamDescriptor | csd
The descriptor used to describe the underlying source stream. |
| private UTF8Reader | internalReader
Shared internal reader, closed when the Clob is released. |
| private final PositionedStoreStream | positionedStoreStream
The stream from store, used to read bytes from the database. |
| private volatile boolean | released
Tells whether this Clob has been released or not. |
| private final Object | synchronizationObject
Object used for synchronizing access to the store stream. |
| private FilterReader | unclosableInternalReader
The internal reader wrapped so that it cannot be closed. |
| Access | Constructor and Description |
|---|---|
| public | StoreStreamClob(CharacterStreamDescriptor
descriptor for the source stream, including a reference to it csd, ConnectionChild the connection (child) this Clob belongs to conChild)Creates a new Clob based on a stream from store. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public long | Returns: Number of characters in the Clob.Implements org. Returns the number of characters in the Clob. |
| public long | Returns: The number of characters in the Clob, or-1 if unknown.Implements org. Returns the cached character count for the Clob, if any. |
| public Reader | Returns: A reader initialized at the specified position.1-based character position. characterPosition)Implements org. Returns an internal reader for the Clob, initialized at the specified character position. |
| public InputStream | Returns: A stream serving the bytes of this Clob, initialized at byte 0 of the data. The buffer must be assumed to be unbuffered, but no such guarantee is made.Implements org. Returns a stream serving the raw bytes of this Clob. |
| public Reader | Returns: A reader initialized at the specified position.character position. The first character is at position 1. pos)Implements org. Returns a reader for the Clob, initialized at the specified character position. |
| public long | Returns: Zero (read-only Clob).Implements org. Returns the update count of this Clob. |
| public Writer | getWriter(long
the starting character position. The first character is
at position pos)1.Implements org. Not supported. |
| public long | insertString(String
the string to insert str, long the character position the string will be inserted at. Must be
between pos)1 and clob.length() +1, inclusive.Implements org. Not supported. |
| public boolean | Returns: true if released, false if not.Implements org. Tells if this Clob has been released. |
| public boolean | Returns: false, this Clob is read-only.Implements org. Tells if this Clob can be modified. |
| private static SQLException | Returns: ASQLException wrapped around the real cause of the errorreal cause of error that we want to "ignore" with respect to
transaction context cleanup t)Wrap real exception in a |
| public void | release()
Implements org. Releases resources associated with this Clob. |
| public void | truncate(long
the length in characters to truncate to newLength)Implements org. Not supported. |
| conChild | back to summary |
|---|---|
| private final ConnectionChild conChild The connection (child) this Clob belongs to. | |
| csd | back to summary |
|---|---|
| private CharacterStreamDescriptor csd The descriptor used to describe the underlying source stream. | |
| internalReader | back to summary |
|---|---|
| private UTF8Reader internalReader Shared internal reader, closed when the Clob is released.
This is a performance optimization, and the stream is shared between
"one time" operations, for instance Note Do not publish this reader to the end-user. | |
| positionedStoreStream | back to summary |
|---|---|
| private final PositionedStoreStream positionedStoreStream The stream from store, used to read bytes from the database.
To be able to support the requirements, the stream must implement
| |
| released | back to summary |
|---|---|
| private volatile boolean released Tells whether this Clob has been released or not. | |
| synchronizationObject | back to summary |
|---|---|
| private final Object synchronizationObject Object used for synchronizing access to the store stream. | |
| unclosableInternalReader | back to summary |
|---|---|
| private FilterReader unclosableInternalReader The internal reader wrapped so that it cannot be closed. | |
| StoreStreamClob | back to summary |
|---|---|
| public StoreStreamClob(CharacterStreamDescriptor csd, ConnectionChild conChild) throws StandardException Creates a new Clob based on a stream from store.
The stream used as a source for this Clob has to implement the interface
| |
| checkIfValid | back to summary |
|---|---|
| private void checkIfValid() Makes sure the Clob has not been released. All operations are invalid on a released Clob.
| |
| getCharLength | back to summary |
|---|---|
| public long getCharLength() throws SQLException Implements org. Returns the number of characters in the Clob.
| |
| getCharLengthIfKnown | back to summary |
|---|---|
| public long getCharLengthIfKnown() Implements org. Returns the cached character count for the Clob, if any.
| |
| getInternalReader | back to summary |
|---|---|
| public Reader getInternalReader(long characterPosition) throws IOException, SQLException Implements org. Returns an internal reader for the Clob, initialized at the specified character position.
| |
| getRawByteStream | back to summary |
|---|---|
| public InputStream getRawByteStream() throws IOException, SQLException Implements org. Returns a stream serving the raw bytes of this Clob. Note that the stream returned is an internal stream, and it should not be pulished to end users.
| |
| getReader | back to summary |
|---|---|
| public Reader getReader(long pos) throws IOException, SQLException Implements org. Returns a reader for the Clob, initialized at the specified character position.
| |
| getUpdateCount | back to summary |
|---|---|
| public long getUpdateCount() Implements org. Returns the update count of this Clob. Always returns zero, as this Clob cannot be updated.
| |
| getWriter | back to summary |
|---|---|
| public Writer getWriter(long pos) Implements org. Not supported.
| |
| insertString | back to summary |
|---|---|
| public long insertString(String str, long pos) Implements org. Not supported.
| |
| isReleased | back to summary |
|---|---|
| public boolean isReleased() Implements org. Tells if this Clob has been released.
| |
| isWritable | back to summary |
|---|---|
| public boolean isWritable() Implements org. Tells if this Clob can be modified.
| |
| noStateChangeLOB | back to summary |
|---|---|
| private static SQLException noStateChangeLOB(Throwable t) Wrap real exception in a
| |
| release | back to summary |
|---|---|
| public void release() Implements org. Releases resources associated with this Clob. | |
| truncate | back to summary |
|---|---|
| public void truncate(long newLength) Implements org. Not supported.
| |