disappearing images

net6.0
Don Oerkfitz 4 years ago
parent eb7f668341
commit a7cde4a539

@ -89,20 +89,22 @@ namespace Common.Library.SQL.MySQL
if (!DBReader.IsDBNull(columnID))
{
const int CHUNK_SIZE = 2 * 1024;
byte[] buffer = new byte[CHUNK_SIZE];
long bytesRead;
long fieldOffset = 0;
using (var stream = new MemoryStream())
{
while ((bytesRead = DBReader.GetBytes(columnID, fieldOffset, buffer, 0, buffer.Length)) == buffer.Length)
{
stream.Write(buffer, 0, (int)bytesRead);
fieldOffset += bytesRead;
}
rv = stream.ToArray();
}
// const int CHUNK_SIZE = 2 * 1024;
// byte[] buffer = new byte[CHUNK_SIZE];
// long bytesRead;
// long fieldOffset = 0;
// using (var stream = new MemoryStream())
// {
// while ((bytesRead = DBReader.GetBytes(columnID, fieldOffset, buffer, 0, buffer.Length)) == buffer.Length)
// {
// stream.Write(buffer, 0, (int)bytesRead);
// fieldOffset += bytesRead;
// }
// rv = stream.ToArray();
// }
rv = (byte[])DBReader[columnID];
}
return rv;

Loading…
Cancel
Save