com.pivotal.gemfirexd.internal.client.am

## Class UpdateSensitiveLOBLocatorInputStream

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

All Implemented Interfaces:
  Closeable, AutoCloseable

Direct Known Subclasses:
  UpdateSensitiveBlobLocatorInputStream, UpdateSensitiveClobLocatorInputStream

    public abstract class UpdateSensitiveLOBLocatorInputStream
    extends InputStream

Super-class of the Update sensitive locator streams. Before a read operation if performed on the stream this stream verifies that the underlying LOB has not changed and if it has it recreates the specific streams. Since Locator streams are specific to Blob and Clob the sub-classes would take care of creating the appropriate streams.

### Field Summary

Fields
`protected Connection` `con`
`protected long` `currentPos`
`protected long` `length`

### Constructor Summary

Constructors
`protected` `UpdateSensitiveLOBLocatorInputStream(Connection con, Lob lob, InputStream is)` Initializes the InputStream, updateCount, currentPos and the connection to the appropriate values.
`protected` `UpdateSensitiveLOBLocatorInputStream(Connection con, Lob lob, InputStream is, long pos, long len)` Initializes the InputStream, updateCount, currentPos, length and the connection to the appropriate values.

### Method Summary

Methods
`void` `close()`
`int` `read()`
`int` `read(byte[] b, int off, int len)`
`protected abstract InputStream` `reCreateStream()` Abstract method that will be implemented by the underlying streams specific to Clob and Blob.

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

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

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

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

### Field Detail

#### con

    protected Connection con

#### currentPos

    protected long currentPos

#### length

    protected long length

### Constructor Detail

#### UpdateSensitiveLOBLocatorInputStream

    protected UpdateSensitiveLOBLocatorInputStream(Connection con,
                                        Lob lob,
                                        InputStream is)
                                            throws SqlException

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

Parameters:
  `con` - connection to be used to read the `Lob` value from the server
  `lob` - `Lob` object which could be a `Blob` or a `Clob`.
  `is` - an `InputStream` that contains the appropriate locator stream instance.
Throws:
  `SqlException`

#### UpdateSensitiveLOBLocatorInputStream

    protected UpdateSensitiveLOBLocatorInputStream(Connection con,
                                        Lob lob,
                                        InputStream is,
                                        long pos,
                                        long len)
                                            throws SqlException

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

Parameters:
  `con` - connection to be used to read the `Lob` value from the server
  `lob` - `Lob` object which could be a `Blob` or a `Clob`.
  `is` - an `InputStream` that contains the appropriate locator stream instance.
  `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

Specified by:
  `read` in class `InputStream`
Throws:
  `IOException`
See Also:
  `InputStream.read()`

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

#### close

    public void close()
               throws IOException

Specified by:
  `close` in interface `Closeable`
Specified by:
  `close` in interface `AutoCloseable`
Overrides:
  `close` in class `InputStream`
Throws:
  `IOException`

#### reCreateStream

    protected abstract InputStream reCreateStream()
                                           throws SqlException

Abstract method that will be implemented by the underlying streams specific to Clob and Blob.

Throws:
  `SqlException`