I do like this:
var
stream: TBytesStream;
begin
if not DataSet.FieldByName('blobfield').IsNull then
begin
stream := TBytesStream.Create(DataSet.FieldByName('blobfield').AsBytes);
// do something with the stream
FreeAndNil(stream);
end;
end;
I prefer to use TBytesStreamit because it does the same things that I usually use TMemoryStreamfor, and if you look at its constructor, it does not redistribute the memory and copy binary data to it, as TMemoryStreamit does.
TMemoryStream, TBytesStream TMemoryStream TBytesStream.SaveToStream().