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
4
votes
2 answers

Parse binary data for c# bootp server?

I need one of my C# .NET applications to act as a bootp server. The protocol is pretty simple but I dont know an easy way to build/parse the binary data. Any ideas: (source: tcpipguide.com)
Tim
  • 7,746
  • 3
  • 49
  • 83
4
votes
2 answers

Java: parsing unsigned binary data

I have a well defined binary data and I want to write Java API for it. The file format is like File Signature char[4] 4 bytes File Source ID unsigned short 2 bytes Header Size unsigned long 4 bytes Max …
Saddy
  • 313
  • 4
  • 22
4
votes
4 answers

How do I get SVN to realize a binary file's changed if the filesize is fixed

I'm working with a program that writes data to fixed-size binary files that I store in a subversion archive. The problem, however, is SVN (both the command-line client and TortiseSVN) thinks that since the size of the file didn't change, the file…
MiffTheFox
  • 21,302
  • 14
  • 69
  • 94
4
votes
4 answers

Parallel Binary DeSerialization?

I have a solution where I need to read objects into memory very quickly, however the binary stream might be cached compressed in memory to save time on disk io. I've tinkered around with different solutions, obviously XmlTextWriter and…
Homde
  • 4,246
  • 4
  • 34
  • 50
4
votes
1 answer

Can I insert binary data into MySQL TEXT column?

Is it possible to insert binary data into MySQL TEXT column? I have a table that I'd like to use for storing both UTF-8 text and binary data (very basic structure - id int(11), type char(1), data text), but when I try to insert some binary data…
Martin M.
  • 71
  • 1
  • 5
4
votes
1 answer

In-depth understanding of binary files

I am learning C++ specially about binary file structure/manipulation, and since I am totally new to the subject of binary files, bits, bites & hexadecimal numbers, I decided to take one step backward and establish a solid understanding on the…
blue thief
  • 113
  • 3
  • 14
4
votes
1 answer

"TypeError: 'list' does not support the buffer interface" when writing bytes to file

I get the error TypeError: 'list' does not support the buffer interface when trying to run the following: file = open(filename + ".bmp", "rb") data = file.read() file.close() new = [] for byte in data: byte = int(byte) if byte%2:#make even…
Dakeyras
  • 1,829
  • 5
  • 26
  • 33
4
votes
2 answers

Writing/Reading 2D array to Binary File C++

I am trying to write data from a 2D array into a binary file. I am only writing the data that has a value greater than 0. Therefore, if the data is is 0, it will not be written to the file. The data is as follows: Level 0 1 2 3 4 …
4
votes
1 answer

pm3d in gnuplot with binary data

I have some data files with content a1 b1 c1 d1 a1 b2 c2 d2 ... [blank line] a2 b1 c1 d1 a2 b2 c2 d2 ... I plot this with gnuplot using splot 'file' u 1:2:3:4 w pm3d. Now, I want to use a binary file. I created the file with Fortran using…
hel
  • 43
  • 1
  • 4
4
votes
1 answer

How to depend the length of one token on the value of another token?

I want to tokenize some binary data where the length of some parts depend on the value of a previous token. You can think of that as follows: Let’s say length is two bytes unsigned integer that denotes the length of binary…
Gumbo
  • 643,351
  • 109
  • 780
  • 844
4
votes
1 answer

bitwise XOR, on fixed length binary string (240 Byte) in SQL

I'm storing a 240 Byte (1920 Bit) binary string in a database (currently MySQL however I want to remain database independent). I need to do the following: UPDATE `my_table` SET `data` = `data` ^ 'new_data' WHERE `id` = 'field_id' I believe SQL…
Glen Fletcher
  • 644
  • 5
  • 21
4
votes
2 answers

Java convert bytes to binary safe string

I have some data in bytes, and I want to put them into Redis, but Redis only accepts binary safe string, and my data has some binary non-safe bytes. So how can I convert these bytes into binary safe string so that I can save them to Redis? Base64…
jiluo
  • 2,296
  • 3
  • 21
  • 34
4
votes
4 answers

Basic Binary Reading

I am trying to read a file using BinaryReader. However, I am having trouble in retrieving the value that is expected. using (BinaryReader b = new BinaryReader(File.Open("file.dat", FileMode.Open))) { int result = b.ReadInt32(); //expected to be…
rooter
  • 173
  • 2
  • 3
  • 9
4
votes
3 answers

How to download and save a file using drakma:http-request and flexistreams

I am trying to download and save a PDF but it fails while writing with an EOF-Error. What would be the correct way of doing this? (with-open-file (file "/home/*/test.pdf" :direction :io :if-does-not-exist…
Sim
  • 4,199
  • 4
  • 39
  • 77
4
votes
3 answers

Invoking a function (main()) from a binary file in C

I have simple c program like, my_bin.c: #include int main() { printf("Success!\n"); return 0; } I compile it with gcc and got executable: my_bin. Now I want to invoke main (or run this my_bin) using another C program. That I did…
code muncher
  • 1,592
  • 2
  • 27
  • 46