當前位置: 首頁>>代碼示例>>C#>>正文


C# SqliteDataReader.GetBytes方法代碼示例

本文整理匯總了C#中Mono.Data.Sqlite.SqliteDataReader.GetBytes方法的典型用法代碼示例。如果您正苦於以下問題:C# SqliteDataReader.GetBytes方法的具體用法?C# SqliteDataReader.GetBytes怎麽用?C# SqliteDataReader.GetBytes使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在Mono.Data.Sqlite.SqliteDataReader的用法示例。


在下文中一共展示了SqliteDataReader.GetBytes方法的3個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C#代碼示例。

示例1: getBytes

    //Metodo para conversion de imagenes de tipo BLOB a array de bytes
    public static byte[] getBytes(int columna,SqliteDataReader reader)
    {
        const int CHUNK_SIZE = 2 * 1024;
        byte[] buffer = new byte[CHUNK_SIZE];
        long bytesRead;
        long fieldOffset = 0;
        int bufferoffset = 0;
        using (MemoryStream stream = new MemoryStream())

        {
            while ((bytesRead = reader.GetBytes(columna, fieldOffset, buffer, bufferoffset, buffer.Length)) > 0)
            {
                stream.Write(buffer, 0, (int)bytesRead);
                fieldOffset += bytesRead;
            }
            return stream.ToArray();
        }
    }
開發者ID:racsoraul,項目名稱:COMPDES_2015,代碼行數:19,代碼來源:SQLite.cs

示例2: GetBytes

 private static byte[] GetBytes(SQLiteDataReader reader)
 {
     const int CHUNK_SIZE = 2 * 1024;
     byte[] buffer = new byte[CHUNK_SIZE];
     long bytesRead;
     long fieldOffset = 0;
     using (MemoryStream stream = new MemoryStream())
     {
         while ((bytesRead = reader.GetBytes(0, fieldOffset, buffer, 0, buffer.Length)) > 0)
         {
             byte[] actualRead = new byte[bytesRead];
             Buffer.BlockCopy(buffer, 0, actualRead, 0, (int)bytesRead);
             stream.Write(actualRead, 0, actualRead.Length);
             fieldOffset += bytesRead;
         }
         return stream.ToArray();
     }
 }
開發者ID:HansMaiser,項目名稱:Vocaluxe,代碼行數:18,代碼來源:CDataBase.cs

示例3: ReadBinaryBlob

        static int ReadBinaryBlob(SqliteDataReader 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);
        }
開發者ID:vdaron,項目名稱:MimeKit,代碼行數:11,代碼來源:X509CertificateDatabase.cs


注:本文中的Mono.Data.Sqlite.SqliteDataReader.GetBytes方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。