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
0
votes
1 answer

What does it mean if binary data is "4 byte single format" and how do I read it in JavaScript?

I have to read a binary file which is said to be encoded 4 byte single format and never having to work with binary data, I don't know what this means. I can do this reading a file with binary data in JavaScript: d = new FileReader(); d.onload =…
frequent
  • 27,643
  • 59
  • 181
  • 333
0
votes
1 answer

Which is faster - comparing binary data or line-wise strings?

Problem I am describing a very simplified version of my problem here. I have a huge file (10-50GB) which I need to split into millions of chunks. Suppose I have certain lines containing a string "SPLITTER". I need to split the file by those lines.…
Nilesh
  • 1,222
  • 1
  • 11
  • 23
0
votes
3 answers

How to convert an UTF-8 string?

I have to use a method that sends a zero terminated string: ssize_t send_utf8 (char *buffer) Where buffer is a string coded as "utf-8" or "ISO-8859-1". This function sends a zero terminated string using another function that sends a buffer (this…
ginosal
  • 35
  • 1
  • 1
  • 6
0
votes
1 answer

Binary constant doesn't download correctly at MSSQL

I need to download some data to MSSQL table. So: INSERT INTO [Project].[dbo].[table1] ([version], [date], [xsd]) VALUES ('3.3.3.3', '20140520', (SELECT * FROM …
user2545071
  • 1,408
  • 2
  • 24
  • 46
0
votes
2 answers

binary to decimal using CharAt( ) and length( )

Ive written a program for converting binary to decimal, however I was wondering how can I do it without using Math.pow ( ) and by only using methods charAt ( ) and length() thank you,, any help would be appreciated public class BinaryToDecimal{ …
0
votes
1 answer

Node tcp socket: Read binary data from Enfora MT4000

I'm working with an Enfora MT4000 device. The device sends data to tcp or udp server when certain event has occurred. Data can be send in binary or ASCII format, but I need to use binary. Enfora device is configured with AT commands like…
0
votes
2 answers

Regular expression for binary files

How would you use regular expressions to parse through binary files? What I have so far import re format = re.compile() <-- f.open("input.dat", "rb") for line in f.readlines(): data = re.search(format, line) I'm not sure what to put inside…
Liondancer
  • 15,721
  • 51
  • 149
  • 255
0
votes
0 answers

Binary multiplication and addition in terms of elementary operations (AND,OR,XOR,SHIFT...)

Let's assume we are given N1 and N2: q-bit length 2 binary numbers. For simplicity, both are unsigned integers. Can we express multiplication or addition of N1 and N2 in terms of the number of bit-wise operations like AND, OR, XOR, SHIFT needed to…
0
votes
2 answers

binary to float or double assignment error

why assignment of binary to float or double is causing an error. here is my first code which works well- float myFloat1 = 0b111; //prints 7.0 double myDouble1 = 0b111; //prints 7.0 here is the second code float myFloat2 = 0b111f; //compiler…
Hello World
  • 944
  • 2
  • 15
  • 39
0
votes
1 answer

BinData::Record with Array read fails while write works

Per the example below, I am able to create a new BinData::Record that includes a BinData::Array element, and am able to create a binary string from new objects of that class type. However, when I then try to instantiate a new object from that binary…
Robert Vizza
  • 125
  • 1
  • 9
0
votes
3 answers

Assignment operator - per member or binary copy?

I was wondering, as long as all included assignments have no side effects except transferring a binary value to an address, isn't it more efficient to just copy the bytes from the source object pointer to the target instead of assigning each target…
user2341104
0
votes
3 answers

Binary file format: why did the system read all the 4 bytes and displayed the value correctly as 25736483

Using a c# program BinaryWriter class I am writing 2 words in a file bw.write(i); bw.write(s); where i is an integer with value 25736483. and s is a string with value I am happy I am reading the file again and outputting the value to a…
WoodyStory
  • 471
  • 1
  • 4
  • 9
0
votes
2 answers

Missed characters in cout_ing?

i'm trying to make a code can convert an image to binary(o-1) and it worked well but there are many symbols (ASCII characters) missed in the result of my code while when i open the image in hex editor i find the full image converted and i find these…
0
votes
1 answer

Import binary data using a different scanning direction

I have a C code that computes some physical variable on a 2D space (e.g. x-velocity "u" and y-velocity "v", where "u" and "v" are functions of spacial coordinates "x" and "y" : "u=u(x,y)" and "v=v(x,y)"). It then exports the results in a binary file…
Gael Lorieul
  • 3,006
  • 4
  • 25
  • 50
0
votes
0 answers

PHP binary files (images) corrupted when stored in database but not DOCs from email attachments

The problem is when I receive email attachments images/binary data becomes corrupted however when I upload files to the same database table they aren't corrupted. On the left side is the normal image that works (when renamed to PHP and it's binary…
John
  • 1
  • 13
  • 98
  • 177