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)) if (!DBReader.IsDBNull(columnID))
{ {
const int CHUNK_SIZE = 2 * 1024; // const int CHUNK_SIZE = 2 * 1024;
byte[] buffer = new byte[CHUNK_SIZE]; // byte[] buffer = new byte[CHUNK_SIZE];
long bytesRead; // long bytesRead;
long fieldOffset = 0; // long fieldOffset = 0;
using (var stream = new MemoryStream()) // using (var stream = new MemoryStream())
{ // {
while ((bytesRead = DBReader.GetBytes(columnID, fieldOffset, buffer, 0, buffer.Length)) == buffer.Length) // while ((bytesRead = DBReader.GetBytes(columnID, fieldOffset, buffer, 0, buffer.Length)) == buffer.Length)
{ // {
stream.Write(buffer, 0, (int)bytesRead); // stream.Write(buffer, 0, (int)bytesRead);
fieldOffset += bytesRead; // fieldOffset += bytesRead;
} // }
rv = stream.ToArray(); // rv = stream.ToArray();
} // }
rv = (byte[])DBReader[columnID];
} }
return rv; return rv;

Loading…
Cancel
Save