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

Advantage for hex formats like SREC or Intel HEX

I want to ask if someone can explain me the benefit for using hex formats (e.g. by Motorola S-Record or Intel HEX) over using direct binary images like for firmware or memory dumps? I understand that it is useful to have some Meta information about…
Andreas
  • 342
  • 1
  • 10
4
votes
2 answers

Can I use C# Serialization to read a binary file in custom format?

I have a custom binary file which I want to read into my C# program. There are several different formats, some MSB first, some LSB first and some with the variables in different orders. Currently, I have a class which reads the right number of…
Mark
  • 1,759
  • 4
  • 32
  • 44
4
votes
1 answer

Linux cURL vs PHP cURL - POST Request

I have to upload a ZIP file using HTTPS and this is working only via Linux cURL command. I don't understand what i am missing in PHP cURL request... Linux cURL [working]: curl -v -x http://api.test.sandbox.mobile.de:8080 -u USER:PASS -X POST…
Mirela
  • 41
  • 4
4
votes
3 answers

convert binary data to base-64 javaScript

I have a problem to convert binary data to base-64 in JS. I try all the things that exists on the net include this How to parse into base64 string the binary image from response?, but everyone return a wrong base-64 and I don't find why ! **I try…
OriEng
  • 1,424
  • 18
  • 34
4
votes
2 answers

How to unpack 4 bytes of binary data as 3 byte and 1 byte values?

I have 4 bytes of binary data (big-endian) that I want to unpack. If it contained two 2-byte unsigned integer values, this would be straightforward: a, b = data.unpack("C>C>") But what if the data contains a 3-byte value (a) followed by a 1-byte…
kwc
  • 307
  • 2
  • 8
4
votes
2 answers

reading double from binary file in c

can anyone show how to correctly convert binary represented data into double value in C. for example, i have 8 unsigned char values to be converted to double value (let's name it buffer). so buffer[0]'s 0's bit is LSB, and buffer[7]'s 7's bit is…
sdfg
  • 393
  • 2
  • 5
  • 9
4
votes
1 answer

char* and unsigned char* casting

I need to read and write binary data in my program. After doing a little research, it seemed like an unsigned char array might be a good choice to store the data. I open the file in binary mode using the ios::binary flag, but when I go to read or…
James
  • 101
  • 2
4
votes
1 answer

Deep-learning for mapping large binary input

this question may come as being too broad, but I will try to make every sub-topic to be as specific as possible. My setting: Large binary input (2-4 KB per sample) (no images) Large binary output of the same size My target: Using Deep Learning to…
ThE_-_BliZZarD
  • 722
  • 2
  • 12
  • 26
4
votes
2 answers

Sending raw binary and data with cURL

I'm trying to send in POST a raw binary file together with some other data using cURL. Basically, I did that: //Here i create the CURLFile $cfile = new CURLFile($fullpath,'application/xml', $filename); //Data to upload (including the…
greg
  • 433
  • 5
  • 12
4
votes
2 answers

Best way to bundles photos with app: files or in sqlite database?

Lets say that I have an app that lets you browse through a listing of cars found in a Sqlite database. When you click on a car in the listing, it'll open up a view with the description of the car and a photo of the car. My question is: should I…
Bryan Denny
  • 27,363
  • 32
  • 109
  • 125
4
votes
2 answers

Node.js convert binary file to utf8

I have a jrmxl (Jasper report) file stored in a postgresql database in a binary format (bytea). I'm trying to read that file and convert it into a plain jrmxl (XML) file and save it on the disk. Here is what i've tried so far var fs =…
diokey
  • 176
  • 1
  • 2
  • 12
4
votes
1 answer

How to use CME simple binary encoding

Hi I'm looking for an example on how to use the CME Simple Binary Encoding. Is it as simple as generating decoders using the SBETool?
4
votes
3 answers

Sending binary data with HttpURLConnection

i want to use google speech api, i've found this https://github.com/gillesdemey/google-speech-v2/ where everything is explained well, but and im trying to rewrite it into java. File filetosend = new File(path); byte[] bytearray =…
hnnn
  • 504
  • 2
  • 7
  • 24
4
votes
1 answer

R equivalent for numpy 'frombuffer'

To decode a binary answer from a socket connection in Python I would do : import numpy as np answer= b"\x80\x8eaS\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00\x80\x8eaS\x00\x00\x00\x00\x01\x00\x00\x00\x00\x00\x00\x00" datatype = [('da_0',…
Alexis Matelin
  • 194
  • 1
  • 9
4
votes
2 answers

Reading binary image data from a web service into UIImage

I'm consuming a web service in my iPhone app. The web service method returns a response which has several fields (eg. ID, Description, etc..). One of these fields contains binary image data which I need to convert to UIImage in my iPhone…
ravinsp
  • 4,150
  • 2
  • 32
  • 43