I would load the entire blob into a memory stream then let WCF handle the Streaming and Chunking. You can enable streaming in the transportBindings, or look into using MTOM.
[ServiceContract]
public class ContentService
{
[OperationContract]
public Stream GetBlob(int id)
{
byte[] myBlob = GetBytesFromDatabase();
return new MemoryStream(myBlob);
}
}
If you using SQL Server 2008 try sending the stream directly through to the WCF Client
[ServiceContract]
public class ContentService
{
[OperationContract]
public Stream GetBlob(int id)
{
return GetStreamFromDatabase(id);
}
}
See this link on Streaming Messages with WCF