From a7cde4a53919b96b40ff799c1c01fdbe70715e62 Mon Sep 17 00:00:00 2001 From: Don Oerkfitz Date: Mon, 12 Jul 2021 01:08:43 -0500 Subject: [PATCH] disappearing images --- Common.Library/SQL/MySQL/MySQL.cs | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/Common.Library/SQL/MySQL/MySQL.cs b/Common.Library/SQL/MySQL/MySQL.cs index 7b783d4..0697ec6 100644 --- a/Common.Library/SQL/MySQL/MySQL.cs +++ b/Common.Library/SQL/MySQL/MySQL.cs @@ -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;