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

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

Public Member Functions

abstract ReadOnlyStream OpenReader ()
 Provides read access to the data of this Blob by providing a stream. More...
 
virtual void WriteTo (Stream output)
 Writes the data of this Blob to a stream. More...
 

Detailed Description

A base class for streaming data to a database.

Remarks
This class is supposed to represent large binary 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 binary 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 ReadOnlyStream Joutsen.Persistence.Lobs.Blob.OpenReader ( )
pure virtual

Provides read access to the data of this Blob by providing a stream.

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

Implemented in Joutsen.Persistence.Lobs.StreamBlob.

◆ WriteTo()

virtual void Joutsen.Persistence.Lobs.Blob.WriteTo ( Stream  output)
virtual

Writes the data of this Blob to a stream.

Parameters
outputthe stream to write the data to