static int ReadBinaryBlob (DbDataReader reader, int column, ref byte[] buffer)
{
long nread;
// first, get the length of the buffer needed
if ((nread = reader.GetBytes (column, 0, null, 0, buffer.Length)) > buffer.Length)
Array.Resize (ref buffer, (int) nread);
// read the certificate data
return (int) reader.GetBytes (column, 0, buffer, 0, (int) nread);
}