Joutsen Persistence v0.3.0+1-ga730d6d
Public Member Functions | Static Protected Attributes | List of all members
Joutsen.Persistence.Lobs.Clob Class Referenceabstract

A base class for streaming text to a database. More...

Public Member Functions

abstract TextReader OpenReader ()
 Provides read access to the text of this Clob by providing a stream. More...
 
virtual void WriteTo (TextWriter writer)
 Writes the data of this Clob to a TextWriter. More...
 
virtual void WriteTo (Stream output, Encoding encoding)
 Writes the data of this Clob to a stream. More...
 

Static Protected Attributes

const int BUFFERSIZE = 2048
 Size of the bufer for all buffered operations. More...
 

Detailed Description

A base class for streaming text to a database.

Remarks
This class is supposed to represent large text data, trying to keep it out of memory as much as possible. It is immutable and only handles transfering the input data out to a different stream or reader. It is intended to lazy load large text data as much as possible.
It is inspired by http://blog.calyptus.eu/seb/2009/03/large-object-storage-for-nhibernate-and-ddd-part-1-blobs-clobs-and-xlobs/
Since
0.3.0

Member Function Documentation

◆ OpenReader()

abstract TextReader Joutsen.Persistence.Lobs.Clob.OpenReader ( )
pure virtual

Provides read access to the text of this Clob by providing a stream.

Returns
a reader that provides read access to the data
Remarks
The returned reader is not managed and needs to be disposed of outside of this method.

Implemented in Joutsen.Persistence.Lobs.StreamClob, and Joutsen.Persistence.Lobs.TextReaderClob.

◆ WriteTo() [1/2]

virtual void Joutsen.Persistence.Lobs.Clob.WriteTo ( Stream  output,
Encoding  encoding 
)
virtual

Writes the data of this Clob to a stream.


Parameters
outputthe stream to write the data to
encodingthe encoding to use when writing

◆ WriteTo() [2/2]

virtual void Joutsen.Persistence.Lobs.Clob.WriteTo ( TextWriter  writer)
virtual

Writes the data of this Clob to a TextWriter.


Parameters
writerthe writer used to write the data

Member Data Documentation

◆ BUFFERSIZE

const int Joutsen.Persistence.Lobs.Clob.BUFFERSIZE = 2048
staticprotected

Size of the bufer for all buffered operations.