com.pivotal.gemfirexd.internal.client.am

## Class ClobLocatorReader

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

All Implemented Interfaces:
  Closeable, AutoCloseable, Readable

    public class ClobLocatorReader
    extends Reader

An `Reader` that will use an locator to fetch the Clob value from the server.

This `Reader` implementation is pretty basic. No buffering of data is done. Hence, for efficieny #read(char[]) should be used instead of #read(). Marks are not supported, but it should be pretty simple to extend the implementation to support this. A more efficient skip implementation should also be straight-forward.

### Field Summary

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

`lock`

### Constructor Summary

Constructors
Constructor and Description
`ClobLocatorReader(Connection connection, Clob clob)` Create an `Reader` for reading the `Clob` value represented by the given locator based `Clob` object.
`ClobLocatorReader(Connection connection, Clob clob, long pos, long len)` Create an `Reader` for reading the `Clob` value represented by the given locator based `Clob` object.

### Method Summary

Methods
`void` `close()`
`int` `read()`
`int` `read(char[] c, int off, int len)`

### 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

#### ClobLocatorReader

    public ClobLocatorReader(Connection connection,
                     Clob clob)
                      throws SqlException

Create an `Reader` for reading the `Clob` value represented by the given locator based `Clob` object.

Parameters:
  `connection` - connection to be used to read the `Clob` value from the server
  `clob` - `Clob` object that contains locator for the `Clob` value on the server.
Throws:
  `SqlException`

#### ClobLocatorReader

    public ClobLocatorReader(Connection connection,
                     Clob clob,
                     long pos,
                     long len)
                      throws SqlException

Create an `Reader` for reading the `Clob` value represented by the given locator based `Clob` object.

Parameters:
  `connection` - connection to be used to read the `Clob` value from the server
  `clob` - `Clob` object that contains locator for the `Clob` value on the server.
  `pos` - The offset to the first character of the partial value to be retrieved.
  `len` - The length in characters 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:
  `This method fetches one character at a time from the server. For more efficient retrieval, use #read(char[]).`

#### 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()`