# Class MariaDbClob

java.lang.Object
org.mariadb.jdbc.MariaDbBlob
org.mariadb.jdbc.MariaDbClob

All Implemented Interfaces:
  `Serializable, Blob, Clob, NClob`

public class MariaDbClob extends MariaDbBlob implements Clob, NClob, Serializable

See Also:
  - Serialized Form

## Field Summary

### Fields inherited from class MariaDbBlob

`data, length, offset`

## Constructor Summary

Constructors
Constructor
Description
`MariaDbClob()`
Creates an empty Clob.
`MariaDbClob(byte[] bytes)`
Creates a Clob with content.
`MariaDbClob(byte[] bytes, int offset, int length)`
Creates a Clob with content.

## Method Summary

Modifier and Type
Method
Description
`InputStream`
`getAsciiStream()`
`Reader`
`getCharacterStream()`
`Reader`
`getCharacterStream(long pos, long length)`
Returns a Reader object that contains a partial Clob value, starting with the character specified by pos, which is length characters in length.
`String`
`getSubString(long pos, int length)`
Get sub string.
`long`
`length()`
Return character length of the Clob.
`long`
`position(String searchStr, long start)`
`long`
`position(Clob searchStr, long start)`
`OutputStream`
`setAsciiStream(long pos)`
`Writer`
`setCharacterStream(long pos)`
Set character stream.
`int`
`setString(long pos, String str)`
Set String.
`int`
`setString(long pos, String str, int offset, int len)`
`String`
`toString()`
ToString implementation.
`void`
`truncate(long truncateLen)`
Truncates the `BLOB` value that this `Blob` object represents to be `len` bytes in length.

### Methods inherited from class MariaDbBlob

`close, free, getBinaryStream, getBinaryStream, getBytes, position, position, setBinaryStream, setBytes, setBytes`

### Methods inherited from class Object

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

### Methods inherited from interface Clob

`free`

## Constructor Details

### MariaDbClob

public MariaDbClob(byte[] bytes)
Creates a Clob with content.

Parameters:
  `bytes` - the content for the Clob.

### MariaDbClob

public MariaDbClob(byte[] bytes, int offset, int length)
Creates a Clob with content.

Parameters:
  `bytes` - the content for the Clob.
  `offset` - offset
  `length` - length

### MariaDbClob

public MariaDbClob()
Creates an empty Clob.

## Method Details

### toString

public String toString()
ToString implementation.

Overrides:
  `toString` in class `Object`
Returns:
  string value of blob content.

### getSubString

public String getSubString(long pos, int length) throws SQLException
Get sub string.

Specified by:
  `getSubString` in interface `Clob`
Parameters:
  `pos` - position
  `length` - length of sub string
Returns:
  substring
Throws:
  `SQLException` - if pos is less than 1 or length is less than 0

### getCharacterStream

public Reader getCharacterStream()

Specified by:
  `getCharacterStream` in interface `Clob`

### getCharacterStream

public Reader getCharacterStream(long pos, long length) throws SQLException
Returns a Reader object that contains a partial Clob value, starting with the character specified by pos, which is length characters in length.

Specified by:
  `getCharacterStream` in interface `Clob`
Parameters:
  `pos` - the offset to the first character of the partial value to be retrieved. The first character in the Clob is at position 1.
  `length` - the length in characters of the partial value to be retrieved.
Returns:
  Reader through which the partial Clob value can be read.
Throws:
  `SQLException` - if pos is less than 1 or if pos is greater than the number of characters in the Clob or if pos + length is greater than the number of characters in the Clob

### setCharacterStream

public Writer setCharacterStream(long pos) throws SQLException
Set character stream.

Specified by:
  `setCharacterStream` in interface `Clob`
Parameters:
  `pos` - position
Returns:
  writer
Throws:
  `SQLException` - if position is invalid

### getAsciiStream

public InputStream getAsciiStream() throws SQLException

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

### position

public long position(String searchStr, long start)

Specified by:
  `position` in interface `Clob`

### position

public long position(Clob searchStr, long start)

Specified by:
  `position` in interface `Clob`

### setString

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

Specified by:
  `setString` in interface `Clob`
Parameters:
  `pos` - position
  `str` - string
Returns:
  string length
Throws:
  `SQLException` - if UTF-8 conversion failed

### setString

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

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

### setAsciiStream

public OutputStream setAsciiStream(long pos) throws SQLException

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

### length

public long length()
Return character length of the Clob. Assume UTF8 encoding.

Specified by:
  `length` in interface `Blob`
Specified by:
  `length` in interface `Clob`
Overrides:
  `length` in class `MariaDbBlob`
Returns:
  length of the `BLOB` in bytes

### truncate

public void truncate(long truncateLen)
Description copied from class: `MariaDbBlob`
Truncates the `BLOB` value that this `Blob` object represents to be `len` bytes in length.

Specified by:
  `truncate` in interface `Blob`
Specified by:
  `truncate` in interface `Clob`
Overrides:
  `truncate` in class `MariaDbBlob`
Parameters:
  `truncateLen` - the length, in bytes, to which the `BLOB` value that this `Blob` object represents should be truncated