Module org.firebirdsql.jaybird
Package org.firebirdsql.jdbc

# Class FBClob

java.lang.Object
org.firebirdsql.jdbc.FBClob

All Implemented Interfaces:
  `Clob`, `NClob`, `FirebirdClob`

@InternalApi public final class FBClob extends Object implements FirebirdClob, NClob
Implementation of `Clob`.

This class also implements `NClob` so it can be used with the `set/get/updateNClob` methods transparently. It technically does not conform to the JDBC requirements for `NClob`.

This class is internal API of Jaybird. Future versions may radically change, move, or make inaccessible this type. For the public API, refer to the `Clob`, `NClob`, and `FirebirdClob` interfaces.

Author:
  David Jencks

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `FBClob(FBBlob blob)`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `copyCharacterStream(Reader characterStream)`
  Copy data from a character stream into this Blob.
  `void`
  `copyCharacterStream(Reader characterStream, long length)`
  Copy data from a character stream into this Blob.
  `void`
  `free()`
  `InputStream`
  `getAsciiStream()`
  `Reader`
  `getCharacterStream()`
  `Reader`
  `getCharacterStream(long pos, long length)`
  `String`
  `getSubString(long pos, int length)`
  `FBBlob`
  `getWrappedBlob()`
  Retrieves the FBBlob wrapped by this FBClob.
  `long`
  `length()`
  `long`
  `position(String searchstr, long start)`
  `long`
  `position(Clob searchstr, long start)`
  `OutputStream`
  `setAsciiStream(long pos)`
  `Writer`
  `setCharacterStream(long pos)`
  `int`
  `setString(long pos, String str)`
  `int`
  `setString(long pos, String str, int offset, int len)`
  `void`
  `truncate(long len)`

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

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

- ## Constructor Details

  - ### FBClob

    public FBClob(FBBlob blob)

- ## Method Details

  - ### length

    public long length() throws SQLException
    Specified by:
      `length` in interface `Clob`
    Throws:
      `SQLException`

  - ### truncate

    public void truncate(long len) throws SQLException

    This operation is not currently supported

    Specified by:
      `truncate` in interface `Clob`
    Throws:
      `SQLException`

  - ### getSubString

    public String getSubString(long pos, int length) throws SQLException
    Specified by:
      `getSubString` in interface `Clob`
    Throws:
      `SQLException`

  - ### getCharacterStream

    public Reader getCharacterStream() throws SQLException
    Specified by:
      `getCharacterStream` in interface `Clob`
    Throws:
      `SQLException`

  - ### getAsciiStream

    public InputStream getAsciiStream() throws SQLException
    Specified by:
      `getAsciiStream` in interface `Clob`
    Throws:
      `SQLException`

  - ### position

    public long position(String searchstr, long start) throws SQLException

    Jaybird currently does not support this method.

    Specified by:
      `position` in interface `Clob`
    Throws:
      `SQLException`

  - ### position

    public long position(Clob searchstr, long start) throws SQLException

    Jaybird currently does not support this method.

    Specified by:
      `position` in interface `Clob`
    Throws:
      `SQLException`

  - ### setString

    public int setString(long pos, String str) throws SQLException

    Jaybird currently only supports this method for `position == 1`.

    Specified by:
      `setString` in interface `Clob`
    Throws:
      `SQLException`

  - ### setString

    public int setString(long pos, String str, int offset, int len) throws SQLException

    Jaybird currently only supports this method for `position == 1`.

    Specified by:
      `setString` in interface `Clob`
    Throws:
      `SQLException`

  - ### setAsciiStream

    public OutputStream setAsciiStream(long pos) throws SQLException
    Specified by:
      `setAsciiStream` in interface `Clob`
    Throws:
      `SQLException`

  - ### setCharacterStream

    public Writer setCharacterStream(long pos) throws SQLException
    Specified by:
      `setCharacterStream` in interface `Clob`
    Throws:
      `SQLException`

  - ### free

    public void free() throws SQLException
    Specified by:
      `free` in interface `Clob`
    Throws:
      `SQLException`

  - ### getCharacterStream

    public Reader getCharacterStream(long pos, long length) throws SQLException
    Specified by:
      `getCharacterStream` in interface `Clob`
    Throws:
      `SQLException`

  - ### copyCharacterStream

    public void copyCharacterStream(Reader characterStream, long length) throws SQLException
    Copy data from a character stream into this Blob.

    Calling with length `-1` is equivalent to calling `copyCharacterStream(Reader)`.

    Parameters:
      `characterStream` - the source of data to copy
      `length` - The maximum number of bytes to copy, or `-1` to read the whole stream
    Throws:
      `SQLException`

  - ### copyCharacterStream

    public void copyCharacterStream(Reader characterStream) throws SQLException
    Copy data from a character stream into this Blob.
    Parameters:
      `characterStream` - the source of data to copy
    Throws:
      `SQLException`

  - ### getWrappedBlob

    public FBBlob getWrappedBlob() throws SQLException
    Retrieves the FBBlob wrapped by this FBClob.
    Returns:
      FBBlob instance
    Throws:
      `SQLException`