Delphi: how to efficently read a big binary file, converting it to hexadecimal for passing it as a v

Posted by user193655 on Stack Overflow See other posts from Stack Overflow or by user193655
Published on 2010-05-12T08:10:00Z Indexed on 2010/05/12 8:14 UTC
Read the original article Hit count: 283

I need to convert a binary file (a zip file) into hexadecimal representation, to then send it to sql-server as a varbinary(max) function parameter.

A full example (using a very small file!) is:

1) my file contains the following bits 000011110000111

2) I need a procedure to QUICKLY convert it to 0F0F

3) I will call a sql server function passing 0x0F0F as parameter

The problem is that I have large files (up to 100MB, even if average file size is 100KB files are possible), so I need the fastest way to do this.

Otherwise stated: I need to create the string

'0x'+BinaryDataInHexadecimalRepresentation

in the most efficient way.

Related question: passing hexadecimal data to sql server

© Stack Overflow or respective owner

Related posts about delphi

Related posts about hexadecimal