Delphi: how to efficently read a big binary file, converting it to hexadecimal for passing it as a v
- by user193655
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