com.pivotal.gemfirexd.internal.client.am

## Class ClobLocatorInputStream

- java.lang.Object
- - java.io.InputStream
  - - com.pivotal.gemfirexd.internal.client.am.ClobLocatorInputStream

All Implemented Interfaces:
  Closeable, AutoCloseable

    public class ClobLocatorInputStream
    extends InputStream

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

Closing a `ByteArrayInputStream` has no effect. The methods in this class can be called after the stream has been closed without generating an `IOException`.

This `InputStream` implementation is pretty basic. No buffering of data is done. Hence, for efficieny #read(byte[]) 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.

### Constructor Summary

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

### Method Summary

Methods
`int` `read()`
`int` `read(byte[] b, int off, int len)`

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

`available, close, mark, markSupported, read, reset, skip`

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

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

### Constructor Detail

#### ClobLocatorInputStream

    public ClobLocatorInputStream(Connection connection,
                          Clob clob)
                           throws SqlException

Create an `InputStream` 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`

#### ClobLocatorInputStream

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

Create an `InputStream` 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 position inside the `Clob`from which the reading must begin.``
Throws:
  `SqlException`

### Method Detail

#### read

    public int read()
             throws IOException

Specified by:
  `read` in class `InputStream`
Throws:
  `IOException`
See Also:
  `This method fetches one byte at a time from the server. For more efficient retrieval, use #read(byte[]).`

#### read

    public int read(byte[] b,
           int off,
           int len)
             throws IOException

Overrides:
  `read` in class `InputStream`
Throws:
  `IOException`
See Also:
  `InputStream.read(byte[], int, int)`