com.pivotal.gemfirexd.internal.client.am

## Class UpdateSensitiveClobLocatorReader

- java.lang.Object
- - java.io.Reader
  - - com.pivotal.gemfirexd.internal.client.am.UpdateSensitiveClobLocatorReader

All Implemented Interfaces:
  Closeable, AutoCloseable, Readable

    public class UpdateSensitiveClobLocatorReader
    extends Reader

Wraps a Buffered Clob locator reader and watches out for updates on the Clob associated with it. Before a read operation is performed on the Reader this stream verifies that the underlying Clob has not changed and if it has it recreates the specific streams.

### Field Summary

### Fields inherited from class java.io.Reader

`lock`

### Constructor Summary

Constructors
`protected` `UpdateSensitiveClobLocatorReader(Connection con, Clob clob)` Initializes the Reader, updateCount, currentPos and the connection to the appropriate values.
`protected` `UpdateSensitiveClobLocatorReader(Connection con, Clob clob, long pos, long len)` Initializes the Reader, updateCount, currentPos, length and the connection to the appropriate values.

### Method Summary

Methods
`void` `close()`
`int` `read()`
`int` `read(char[] c, int off, int len)`
`protected Reader` `reCreateStream()` Re-creates the underlying Locator stream with the current position and the length values if specified.

### Methods inherited from class java.io.Reader

`mark, markSupported, read, read, ready, reset, skip`

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

`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

### Constructor Detail

#### UpdateSensitiveClobLocatorReader

    protected UpdateSensitiveClobLocatorReader(Connection con,
                                    Clob clob)
                                        throws SqlException

Initializes the Reader, updateCount, currentPos and the connection to the appropriate values.

Parameters:
  `con` - connection to be used to read the `Clob` value from the server
  `clob` - the `Clob` object associated with this stream.
Throws:
  `SqlException`

#### UpdateSensitiveClobLocatorReader

    protected UpdateSensitiveClobLocatorReader(Connection con,
                                    Clob clob,
                                    long pos,
                                    long len)
                                        throws SqlException

Initializes the Reader, updateCount, currentPos, length and the connection to the appropriate values.

Parameters:
  `con` - connection to be used to read the `Clob` value from the server
  `clob` - the `Clob` object associated with this reader.
  `pos` - the position from which the first read begins.
  `len` - the length in bytes of the partial value to be retrieved.
Throws:
  `SqlException`

### Method Detail

#### read

    public int read()
             throws IOException

Overrides:
  `read` in class `Reader`
Throws:
  `IOException`
See Also:
  `Reader.read()`

#### read

    public int read(char[] c,
           int off,
           int len)
             throws IOException

Specified by:
  `read` in class `Reader`
Throws:
  `IOException`
See Also:
  `Reader.read(char[], int, int)`

#### close

    public void close()
               throws IOException

Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `AutoCloseable`
Specified by:
  `close` in class `Reader`
Throws:
  `IOException`
See Also:
  `Reader.close()`

#### reCreateStream

    protected Reader reCreateStream()
                             throws SqlException

Re-creates the underlying Locator stream with the current position and the length values if specified.

Throws:
  `SqlException`