com.pivotal.gemfirexd.internal.client.am

## Class ClobLocatorOutputStream

- java.lang.Object
- - java.io.OutputStream
  - - com.pivotal.gemfirexd.internal.client.am.ClobLocatorOutputStream

All Implemented Interfaces:
  Closeable, Flushable, AutoCloseable

    public class ClobLocatorOutputStream
    extends OutputStream

An `OutputStream` that will use an locator to write bytes to the Clob value on 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 `OutputStream` implementation is pretty basic. No buffering of data is done. Hence, for efficieny #write(byte[]) should be used instead of #write(int).

### Constructor Summary

Constructors
Constructor and Description
`ClobLocatorOutputStream(Connection connection, Clob clob, long pos)` Create an `OutputStream` for writing to the `Clob` value represented by the given locator based `Clob` object.

### Method Summary

Methods
`void` `flush()`
`void` `write(byte[] b)`
`void` `write(byte[] b, int off, int len)`
`void` `write(int b)`

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

`close`

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

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

### Constructor Detail

#### ClobLocatorOutputStream

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

Create an `OutputStream` for writing to the `Clob` value represented by the given locator based `Clob` object.

Parameters:
  `connection` - connection to be used to write to the `Clob` value on the server
  `clob` - `Clob` object that contains locator for the `Clob` value on the server.
  `pos` - the position in the `CLOB` value at which to start writing; the first position is 1
Throws:
  `SqlException`

### Method Detail

#### write

    public void write(int b)
               throws IOException

Specified by:
  `write` in class `OutputStream`
Throws:
  `IOException`
See Also:
  `This method writes one byte at a time to the server. For more efficient writing, use #write(byte[]).`

#### write

    public void write(byte[] b)
               throws IOException

Overrides:
  `write` in class `OutputStream`
Throws:
  `IOException`
See Also:
  `OutputStream.write(byte[])`

#### write

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

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

#### flush

    public void flush()

Specified by:
  `flush` in interface `Flushable`
Overrides:
  `flush` in class `OutputStream`
See Also:
  `OutputStream.flush()`