class JdbcClob extends ClobBase {

    private final JdbcConnection conn;

    /**
     * INTERNAL
     */
    public JdbcClob(JdbcConnection conn, Value value, int id) {
        this.conn = conn;
        this.value = value;
        this.trace = conn.getTrace(TraceObjectType.CLOB, id);
    }

    @Override
    protected void checkClosed() {
        conn.checkClosed();
        super.checkClosed();
    }

    @Override
    public Writer setCharacterStream(long pos) throws SQLException {<FILL_FUNCTION_BODY>}

    @Override
    public int setString(long pos, String str) throws SQLException {
        try {
            if (isDebugEnabled()) {
                debugCode("setString(" + pos + ", " + quote(str) + ");");
            }
            checkClosed();
            if (pos != 1) {
                throw DbException.getInvalidValueException("pos", pos);
            } else if (str == null) {
                throw DbException.getInvalidValueException("str", str);
            }
            value = conn.createClob(new StringReader(str), -1);
            return str.length();
        } catch (Exception e) {
            throw logAndConvert(e);
        }
    }
}

        try {
            if (isDebugEnabled()) {
                debugCodeCall("setCharacterStream(" + pos + ");");
            }
            checkClosed();
            if (pos != 1) {
                throw DbException.getInvalidValueException("pos", pos);
            }
            if (value.getPrecision() != 0) {
                throw DbException.getInvalidValueException("length", value.getPrecision());
            }
            final JdbcConnection c = conn;
            // PipedReader / PipedWriter are a lot slower
            // than PipedInputStream / PipedOutputStream
            // (Sun/Oracle Java 1.6.0_20)
            final PipedInputStream in = new PipedInputStream();
            final Task task = new Task() {
                @Override
                public void call() {
                    value = c.createClob(IOUtils.getReader(in), -1);
                }
            };
            PipedOutputStream out = new PipedOutputStream(in) {
                @Override
                public void close() throws IOException {
                    super.close();
                    try {
                        task.get();
                    } catch (Exception e) {
                        throw DbException.convertToIOException(e);
                    }
                }
            };
            task.execute();
            return IOUtils.getBufferedWriter(out);
        } catch (Exception e) {
            throw logAndConvert(e);
        }
    
<methods>public non-sealed void <init>() ,public void free() ,public java.io.InputStream getAsciiStream() throws java.sql.SQLException,public java.io.Reader getCharacterStream() throws java.sql.SQLException,public java.io.Reader getCharacterStream(long, long) throws java.sql.SQLException,public java.lang.String getSubString(long, int) throws java.sql.SQLException,public com.lealone.db.value.Value getValue() ,public long length() throws java.sql.SQLException,public long position(java.lang.String, long) throws java.sql.SQLException,public long position(java.sql.Clob, long) throws java.sql.SQLException,public java.io.OutputStream setAsciiStream(long) throws java.sql.SQLException,public abstract java.io.Writer setCharacterStream(long) throws java.sql.SQLException,public abstract int setString(long, java.lang.String) throws java.sql.SQLException,public int setString(long, java.lang.String, int, int) throws java.sql.SQLException,public java.lang.String toString() ,public void truncate(long) throws java.sql.SQLException<variables>protected com.lealone.db.value.Value value