org.norther.tammi.root.db.lob
Class DefaultClob

java.lang.Object
  extended by org.norther.tammi.root.db.lob.DefaultClob
All Implemented Interfaces:
Externalizable, Serializable, Clob

public class DefaultClob
extends Object
implements Clob, Externalizable

A default implementation of java.sql.Clob.

Version:
$Id: DefaultClob.java,v 1.3 2009/09/30 20:16:01 cvsimp Exp $
Author:
Armin Waibel, Ilkka Priha
See Also:
Serialized Form

Constructor Summary
DefaultClob()
          Constructs an empty CLOB.
DefaultClob(File file, boolean... options)
          Constructs a file CLOB.
DefaultClob(File file, String charset, boolean... options)
          Constructs a file CLOB with an encoding.
DefaultClob(Reader rdr)
          Constructs a reader CLOB.
DefaultClob(String str)
          Constructs a string CLOB.
DefaultClob(URL url, boolean... options)
          Constructs an URL CLOB.
DefaultClob(URL url, String charset, boolean... options)
          Constructs an URL CLOB with an encoding.
 
Method Summary
 void free()
           
 InputStream getAsciiStream()
           
 Reader getCharacterStream()
           
 Reader getCharacterStream(long pos, long length)
           
 String getSubString(long pos, int length)
           
 long length()
           
 long position(Clob searchstr, long start)
           
 long position(String searchstr, long start)
           
 void readExternal(ObjectInput in)
           
 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)
           
 void writeExternal(ObjectOutput out)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DefaultClob

public DefaultClob()
Constructs an empty CLOB.


DefaultClob

public DefaultClob(String str)
Constructs a string CLOB.

Parameters:
str - the string.

DefaultClob

public DefaultClob(Reader rdr)
Constructs a reader CLOB.

Parameters:
rdr - the reader.

DefaultClob

public DefaultClob(URL url,
                   boolean... options)
Constructs an URL CLOB.

Parameters:
url - the input URL.
options - stream options.

DefaultClob

public DefaultClob(URL url,
                   String charset,
                   boolean... options)
Constructs an URL CLOB with an encoding.

Parameters:
url - the input URL.
charset - the encoding.
options - stream options.

DefaultClob

public DefaultClob(File file,
                   boolean... options)
Constructs a file CLOB.

Parameters:
file - the input file.
options - stream options.

DefaultClob

public DefaultClob(File file,
                   String charset,
                   boolean... options)
Constructs a file CLOB with an encoding.

Parameters:
file - the input file.
charset - the encoding.
options - stream options.
Method Detail

getAsciiStream

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

setAsciiStream

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

getCharacterStream

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

setCharacterStream

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

getCharacterStream

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

getSubString

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

setString

public int setString(long pos,
                     String str)
              throws SQLException
Specified by:
setString in interface Clob
Throws:
SQLException

setString

public int setString(long pos,
                     String str,
                     int offset,
                     int len)
              throws SQLException
Specified by:
setString in interface Clob
Throws:
SQLException

length

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

position

public long position(String searchstr,
                     long start)
              throws SQLException
Specified by:
position in interface Clob
Throws:
SQLException

position

public long position(Clob searchstr,
                     long start)
              throws SQLException
Specified by:
position in interface Clob
Throws:
SQLException

truncate

public void truncate(long len)
              throws SQLException
Specified by:
truncate in interface Clob
Throws:
SQLException

free

public void free()
Specified by:
free in interface Clob

readExternal

public void readExternal(ObjectInput in)
                  throws IOException,
                         ClassNotFoundException
Specified by:
readExternal in interface Externalizable
Throws:
IOException
ClassNotFoundException

writeExternal

public void writeExternal(ObjectOutput out)
                   throws IOException
Specified by:
writeExternal in interface Externalizable
Throws:
IOException


Copyright © 2004 The Norther Organization. All rights reserved.