Questions tagged [binary-data]

Binary-data is information stored using a two character alphabet (typically written using 0 and 1)

Binary Data is information which is stored using a two character alphabet. For example, the number 42 could be stored as its base-2 representation: 101010.

In modern computers, almost all data is ultimately represented in binary form.

To be useful, the writer and reader of binary data must have a pre-agreed format (e.g. a file consisting of a 32-bit, two's compliment integer followed by three IEEE 754 floating point numbers).

The term is usually used to distinguish data stored in this way against data stored using a textual encoding. For example, the digits of 42 in base-10 (4 and 2) may be represented using ASCII as 00110100 and 00110010. Whether this is considered binary data or not depends on the task at hand; a chat client would consider messages as textual data, but the communication protocol it is built on may consider the same messages as arbitrary binary data.

1585 questions
472
votes
12 answers

Best way to read a large file into a byte array in C#?

I have a web server which will read large binary files (several megabytes) into byte arrays. The server could be reading several files at the same time (different page requests), so I am looking for the most optimized way for doing this without…
Tony_Henrich
  • 42,411
  • 75
  • 239
  • 374
198
votes
9 answers

Binary Data in MySQL

How do I store binary data in MySQL?
Geoff Dalgas
  • 6,116
  • 6
  • 42
  • 58
171
votes
7 answers

best way to preserve numpy arrays on disk

I am looking for a fast way to preserve large numpy arrays. I want to save them to the disk in a binary format, then read them back into memory relatively fastly. cPickle is not fast enough, unfortunately. I found numpy.savez and numpy.load. But…
CuriousMind
  • 15,168
  • 20
  • 82
  • 120
114
votes
12 answers

How do you embed binary data in XML?

I have two applications written in Java that communicate with each other using XML messages over the network. I'm using a SAX parser at the receiving end to get the data back out of the messages. One of the requirements is to embed binary data in…
Bill the Lizard
  • 398,270
  • 210
  • 566
  • 880
84
votes
9 answers

Tools to help reverse engineer binary file formats

What tools are available to aid in decoding unknown binary data formats? I know Hex Workshop and 010 Editor both support structures. These are okay to a limited extent for a known fixed format but get difficult to use with anything more complicated,…
Mat
  • 82,161
  • 34
  • 89
  • 109
76
votes
1 answer

Binary Data Posting with curl

So basically, I'm trying to write a series of scripts to interact with Dot Net Nuke. I've been analysing the traffic and can now login and do some basic tasks. However, I've never handled binary file upload with curl. Would someone be willing to…
user798080
56
votes
8 answers

How to build PDF file from binary string returned from a web-service using javascript

I am trying to build a PDF file out of a binary stream which I receive as a response from an Ajax request. Via XmlHttpRequest I receive the following data: %PDF-1.4.... ..... ....hole data representing the file .... %% EOF What I tried so far was…
Sebb0
  • 581
  • 1
  • 4
  • 4
49
votes
4 answers

"Proper" way to store binary data with C++/STL

In general, what is the best way of storing binary data in C++? The options, as far as I can tell, pretty much boil down to using strings or vectors. (I'll omit the possibility of char*s and malloc()s since I'm referring specifically to…
Sean Edwards
  • 2,062
  • 1
  • 18
  • 19
47
votes
11 answers

Would you store binary data in database or in file system?

This is a question which has been asked before (large-text-and-images-in-sql) but mainly for data which will be changed. In my case the data will be stored and never changed. Just seems sensible to keep everything together. Are there any reasons…
paul
  • 13,312
  • 23
  • 81
  • 144
45
votes
3 answers

Does mysqldump handle binary data reliably?

I have some tables in MySQL 5.6 that contain large binary data in some fields. I want to know if I can trust dumps created by mysqldump and be sure that those binary fields will not be corrupted easily when transferring the dump files trough systems…
Francisco Zarabozo
  • 3,676
  • 2
  • 28
  • 54
44
votes
3 answers

Sending binary data over http

I am looking for suggestions on the best way to send/receive data from a remote GPRS device, over port 80. Creating a plain TCP socket on a random port works fine, but many carriers only allow port 80 HTTP traffic through their proxies, and then…
vgru
  • 49,838
  • 16
  • 120
  • 201
42
votes
2 answers

What is the best file compression of random binary data that you can achieve?

Specifically, what programs are out there and what has the highest compression ratio? I tried Googling it, but it seems experience would trump search results, so I ask.
ox_n
  • 657
  • 1
  • 7
  • 11
40
votes
2 answers

Use binary COPY table FROM with psycopg2

I have tens of millions of rows to transfer from multidimensional array files into a PostgreSQL database. My tools are Python and psycopg2. The most efficient way to bulk instert data is using copy_from. However, my data are mostly 32-bit floating…
Mike T
  • 41,085
  • 18
  • 152
  • 203
40
votes
3 answers

How to insert images in mongoDB using java?

I want to store image documents in MongoDB. I am using java. Any links or suggestions would be appreciated.
user405398
39
votes
7 answers

What is the most efficient binary to text encoding?

The closest contenders that I could find so far are yEnc (2%) and ASCII85 (25% overhead). There seem to be some issues around yEnc mainly around the fact that it uses an 8-bit character set. Which leads to another thought: is there a binary to text…
1
2 3
99 100