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
3 answers

How does c++ interpret a binary number

I have a general question about binary numbers in c++. I am reading in a binary file of 32-bit numbers, and then writing these numbers to a text file. My question is, when I do long int temp; temp = ( fileBuf[N * 4 * i + 4 * j + 0] << 24 | …
bigbenbt
  • 367
  • 2
  • 14
0
votes
2 answers

how to solve an xor'd system of linear equations?

I have this system of equations a⊕0⊕c⊕0⊕0⊕0=2 0⊕b⊕0⊕d⊕0⊕0=3 a⊕0⊕0⊕0⊕x⊕0=4 0⊕b⊕0⊕0⊕0⊕y=8 0⊕0⊕c⊕0⊕x⊕0=6 0⊕0⊕0⊕d⊕0⊕y=11 ⊕ is XOR when i solve this equations using Gaussian, following Denley Bihari's method here it gives me this: 1 0 1 0 0 0 = 2 0 1 0 1…
Salma Nafady
  • 331
  • 4
  • 15
0
votes
1 answer

Linked Lists and binary data in C

I'm trying to write a simple C code for the following function: Given an encoding for the letters a-d: 'a'->00, 'b'->01, 'c'->10, 'd'->11, and a node in a linked-list defined as: typedef struct listNode{ unsigned char data; struct listNode*…
Numerator
  • 1,389
  • 3
  • 21
  • 40
0
votes
0 answers

Using SAS, png files is convert to binary data?

I want to use the chart of SAS on Spotfire. So I tries to create png file as binary data on SAS. Is that possible? I try to import the png file as binary data, but Sas did not. On R, "read.bin" data test2; infile "&filepath" recfm=f; input value…
0
votes
6 answers

Get byte representation of int, using only 3 bytes

What's a nice, readable way of getting the byte representation (i.e. a byte[]) of an int, but only using 3 bytes (instead of 4)? I'm using Hadoop/Hbase and their Bytes utility class has a toBytes function but that will always use 4 bytes. Ideally,…
moinudin
  • 134,091
  • 45
  • 190
  • 216
0
votes
1 answer

Store hex data in DB using Django and Postgres

I've run into a situation where I have binary data (created using os.urandom(BLOCK_SIZE)) that I need to store in a Postgres database using Django Models. I've read several references to how Django doesn't yet support Bytea (VARBINARY) field types…
Rico
  • 5,692
  • 8
  • 46
  • 63
0
votes
1 answer

Binary data conversion to string

I have a chunk of binary data which contains structures with offsets and then strings; in C++ it is easy: struct foo { int offset; char * s; } void * data; ... data is read and set foo * header = (foo*) data; header->s = (int)header-> +…
vbbartlett
  • 179
  • 2
  • 14
0
votes
1 answer

reading binary data and retrieving per condition : working fine in Python 2.6.x but not in Python 3.2

I am reading EXE (size 2 MB) which have some ASCII text too. Trying to retrieve data as per matched conditions. In Python 2.6, following code is working fine (give me result in 2 sec) but not in 3.2. In Python 3.2 , it keep running forever no…
aberry
  • 447
  • 3
  • 10
0
votes
1 answer

Read Word128 from a bytestring

As a haskell newbie i stuck with the problem: I have a binary data in bytestring and i want to convert it to the list of Word128's (assume that binary data is 16 byte aligned). Actually I have troubles even to convert 16 byte bytestring to the…
Aleksander Kois
  • 319
  • 1
  • 3
  • 7
0
votes
1 answer

Read from binary file and convert byte array into string

I'm trying to read the binary data from a binary file with the code below but the it's return the value in the byte array. How can i read the binary data from the binary file and then convert the data into string? This is how i create the binary…
Fire Hand
  • 25,366
  • 22
  • 53
  • 76
0
votes
0 answers

Using Java to upload to FTP server sometimes breaks pictures

I have a program in Java that uses ftp4j library to upload pictures to FTP server. Sometimes the images are fine but sometimes the bottom half of them is either black or don't exist at all (kinda like cut). What could be the reason to it and how to…
Karuvägistaja
  • 293
  • 1
  • 8
  • 17
0
votes
1 answer

How to add a binary file to a datagrid view

im working on a c++ project and i was wondering if i can add the items of a datagrid without using a data base. Using a xxxxxx.dat file. Is that posible? pd:sorry bout my english, im not an english-speaker.
Giuseppe
  • 490
  • 1
  • 11
  • 27
0
votes
1 answer

How to encode xml doc as a base64 binary object

I'm trying to call an xml-rpc web service method that takes 1 parameter (an array of values) key and leads. Key must be named 'key' and must have a value of type string. Leads is an xml document containing the leads data.This must be packaged as a…
Donnie
  • 367
  • 4
  • 14
0
votes
1 answer

python, from json object (hex) to raw internal binary string

in python how can i convert a "json-loaded" object value into raw binary string? ie "0A" to be converted to "1010"? what i do is the following: read a line from a file, ie assume the file contains this line: {"hex":"0A01145af1ab"} i read it with…
UnableToLoad
  • 315
  • 6
  • 18
0
votes
1 answer

Why can I use FileSystemObjects for reading and writing client-side binary files, but not for reading and sending them to the server?

I created a binary file in the following manner (to ensure that all the possible byte values are in the binary file): using (var fs = File.Create(fileName)) { for (byte b = 0; b < Byte.MaxValue; b++) { fs.WriteByte(b); } } and I…
user420667
  • 6,552
  • 15
  • 51
  • 83
1 2 3
99
100