public class MariaDbClob extends MariaDbBlob implements java.sql.Clob, java.sql.NClob, java.io.Serializable
Modifier and Type | Field and Description |
---|---|
private static long |
serialVersionUID |
data, length, offset
Constructor and 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.
|
Modifier and Type | Method and Description |
---|---|
java.io.InputStream |
getAsciiStream() |
java.io.Reader |
getCharacterStream() |
java.io.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.
|
java.lang.String |
getSubString(long pos,
int length)
Get sub string.
|
long |
length()
Return character length of the Clob.
|
long |
position(java.sql.Clob searchStr,
long start) |
long |
position(java.lang.String searchStr,
long start) |
java.io.OutputStream |
setAsciiStream(long pos) |
java.io.Writer |
setCharacterStream(long pos)
Set character stream.
|
int |
setString(long pos,
java.lang.String str)
Set String.
|
int |
setString(long pos,
java.lang.String str,
int offset,
int len) |
java.lang.String |
toString()
ToString implementation.
|
void |
truncate(long len)
Truncates the
BLOB value that this Blob object represents to be len bytes
in length. |
private int |
utf8Position(int charPosition)
Convert character position into byte position in UTF8 byte array.
|
free, getBinaryStream, getBinaryStream, getBytes, position, position, setBinaryStream, setBytes, setBytes
private static final long serialVersionUID
public MariaDbClob(byte[] bytes)
bytes
- the content for the Clob.public MariaDbClob(byte[] bytes, int offset, int length)
bytes
- the content for the Clob.offset
- offsetlength
- lengthpublic MariaDbClob()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String getSubString(long pos, int length) throws java.sql.SQLException
getSubString
in interface java.sql.Clob
pos
- positionlength
- length of sub stringjava.sql.SQLException
- if pos is less than 1 or length is less than 0public java.io.Reader getCharacterStream() throws java.sql.SQLException
getCharacterStream
in interface java.sql.Clob
java.sql.SQLException
public java.io.Reader getCharacterStream(long pos, long length) throws java.sql.SQLException
getCharacterStream
in interface java.sql.Clob
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.java.sql.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 Clobpublic java.io.Writer setCharacterStream(long pos) throws java.sql.SQLException
setCharacterStream
in interface java.sql.Clob
pos
- positionjava.sql.SQLException
- if position is invalidpublic java.io.InputStream getAsciiStream() throws java.sql.SQLException
getAsciiStream
in interface java.sql.Clob
java.sql.SQLException
public long position(java.lang.String searchStr, long start) throws java.sql.SQLException
position
in interface java.sql.Clob
java.sql.SQLException
public long position(java.sql.Clob searchStr, long start) throws java.sql.SQLException
position
in interface java.sql.Clob
java.sql.SQLException
private int utf8Position(int charPosition)
charPosition
- charPositionpublic int setString(long pos, java.lang.String str) throws java.sql.SQLException
setString
in interface java.sql.Clob
pos
- positionstr
- stringjava.sql.SQLException
- if UTF-8 conversion failedpublic int setString(long pos, java.lang.String str, int offset, int len) throws java.sql.SQLException
setString
in interface java.sql.Clob
java.sql.SQLException
public java.io.OutputStream setAsciiStream(long pos) throws java.sql.SQLException
setAsciiStream
in interface java.sql.Clob
java.sql.SQLException
public long length()
length
in interface java.sql.Blob
length
in interface java.sql.Clob
length
in class MariaDbBlob
BLOB
in bytespublic void truncate(long len) throws java.sql.SQLException
MariaDbBlob
BLOB
value that this Blob
object represents to be len
bytes
in length.truncate
in interface java.sql.Blob
truncate
in interface java.sql.Clob
truncate
in class MariaDbBlob
len
- the length, in bytes, to which the BLOB
value that this Blob
object
represents should be truncatedjava.sql.SQLException
- if there is an error accessing the BLOB
value or if len is less than
0