net.sourceforge.jtds.jdbc
Class ClobImpl
java.lang.Object
net.sourceforge.jtds.jdbc.ClobImpl
- Clob
public class ClobImpl
extends java.lang.Object
implements Clob
An in-memory or disk based representation of character data.
Implementation note:
- This implementation stores the CLOB data in a byte array managed by
the
BlobBuffer
class. Each character is stored in 2
sequential bytes using UTF-16LE encoding.
- As a consequence of using UTF-16LE, Unicode 3.1 supplementary
characters may require an additional 2 bytes of storage. This
implementation assumes that character position parameters supplied to
getSubstring
, position
and the
set
methods refer to 16 bit characters only. The presence
of supplementary characters will cause the wrong characters to be
accessed.
- For the same reasons although the position method will return the
correct start position for any given pattern in the array, the returned
value may be different to that expected if supplementary characters
exist in the text preceding the pattern.
$Id: ClobImpl.java,v 1.36 2007/07/08 21:38:13 bheineman Exp $- Brian Heineman
- Mike Hutchinson
EMPTY_CLOB
private static final String EMPTY_CLOB
0 length String
as initial value for empty
Clob
s.
blobBuffer
private final BlobBuffer blobBuffer
The underlying BlobBuffer
.
ClobImpl
(package private) ClobImpl(ConnectionJDBC2 connection)
Constructs a new empty Clob
instance.
connection
- a reference to the parent connection object
ClobImpl
(package private) ClobImpl(ConnectionJDBC2 connection,
String str)
Constructs a new initialized Clob
instance.
connection
- a reference to the parent connection objectstr
- the String
object to encapsulate
getAsciiStream
public InputStream getAsciiStream()
throws SQLException
getBlobBuffer
(package private) BlobBuffer getBlobBuffer()
Obtain this object's backing BlobBuffer
object.
- the underlying
BlobBuffer
getCharacterStream
public Reader getCharacterStream()
throws SQLException
getSubString
public String getSubString(long pos,
int length)
throws SQLException
length
public long length()
throws SQLException
position
public long position(Clob searchStr,
long start)
throws SQLException
position
public long position(String searchStr,
long start)
throws SQLException
setAsciiStream
public OutputStream setAsciiStream(long pos)
throws SQLException
setCharacterStream
public Writer setCharacterStream(long pos)
throws SQLException
setString
public int setString(long pos,
String str)
throws SQLException
setString
public int setString(long pos,
String str,
int offset,
int len)
throws SQLException
truncate
public void truncate(long len)
throws SQLException
Generated on September 18 2009