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

How do I create a progress bar for data loading in R?

Is it possible to create a progress bar for data loaded into R using load()? For a data analysis project large matrices are being loaded in R from .RData files, which take several minutes to load. I would like to have a progress bar to monitor how…
Nixuz
  • 3,439
  • 4
  • 39
  • 44
25
votes
1 answer

Ricoh Theta S - live preview in javascript

I am trying to create an app that talks to the Ricoh Theta S camera using HTTP requests ... they are compliant with Open Spherical Camera API Version 1.0 ... here is their api reference So I am trying to implement the live preview they say the…
Wowzaaa
  • 3,730
  • 4
  • 21
  • 23
24
votes
6 answers

Storing PDF files as binary objects in SQL Server, yes or no?

I have to find a design decision for the following task: I have a SQL Server database and it contains a table of orders. PDF documents will be uploaded by users through a simple file upload from a web page and assigned to an order. There is not more…
Slauma
  • 175,098
  • 59
  • 401
  • 420
23
votes
2 answers

How to best get a byte array from a ClientResponse from Spring WebClient?

I'm trying out the new WebClient from Spring 5 (5.0.0.RC2) in a codebase that uses reactive programming and I've had success mapping the JSON response from an endpoint to a DTO in my app, which works very nice: WebClient client =…
23
votes
1 answer

SQL Server: How to store binary data (e.g. Word file)?

I'm not a DBA, so I just don't know the upsides and downsides of using various methods of storing binary data in an SQL Server. varbinary(n) stores only 8000 bytes varbinary(max) stores 2 GB BLOBs are meant for big files, but come with…
Dennis G
  • 21,405
  • 19
  • 96
  • 133
21
votes
5 answers

Does the mysql CLI tool provide a way to display binary data in a console-friendly manner?

I have a MySQL database containing a table with a binary-typed column. I'd like to be able to project that column without having to run it through, e.g., HEX(). Does the mysql CLI tool have a configuration option or other means to display a…
Richard Simões
  • 12,401
  • 6
  • 41
  • 50
21
votes
5 answers

Output binary data on PowerShell pipeline

I need to pipe some data to a program's stdin: First 4 bytes are a 32-bit unsigned int representing the length of the data. These 4 bytes are exactly the same as C would store an unsigned int in memory. I refer to this as binary data. Remaining…
johnnycrash
  • 5,184
  • 5
  • 34
  • 58
20
votes
4 answers

Unexpected "padding" in a Fortran unformatted file

I don't understand the format of unformatted files in Fortran. For example: open (3,file=filename,form="unformatted",access="sequential") write(3) matrix(i,:) outputs a column of a matrix into a file. I've discovered that it pads the file with 4…
Andrew Spott
  • 3,457
  • 8
  • 33
  • 59
20
votes
6 answers

Delimiting binary sequences

I need to be able to delimit a stream of binary data. I was thinking of using something like the ASCII EOT (End of Transmission) character to do this. However I'm a bit concerned -- how can I know for sure that the particular binary sequence used…
Engineer
  • 8,529
  • 7
  • 65
  • 105
20
votes
2 answers

How to get raw binary data from a POST request processed by Spring?

I need to write an application which would be able to process binary data sent by CUrl, such as: curl localhost:8080/data --data-binary @ZYSF15A46K1.txt I've created a POST processing method as follows: @RequestMapping(method = RequestMethod.POST,…
JonathanReez
  • 1,559
  • 3
  • 21
  • 37
19
votes
2 answers

Error! blahfile is not UTF-8 encoded. Saving disabled

So, I'm trying to write a gzip file, actually from the net, but to simplify I wrote some very basic test. import gzip LINES = [b'I am a test line' for _ in range(100_000)] f = gzip.open('./test.text.gz', 'wb') for line in LINES: …
blissweb
  • 3,037
  • 3
  • 22
  • 33
19
votes
4 answers

Extract Server Name Indication (SNI) from TLS client hello

How would you extract the Server Name Indication (SNI) from a TLS Client Hello message. I'm currently struggling to understand this very cryptic RFC 3546 on TLS Extensions, in which the SNI is defined. Things I've understood so far: The host is…
buschtoens
  • 8,091
  • 9
  • 42
  • 60
18
votes
2 answers

How to output binary data to a file in Java?

I'm trying to write data to a file in binary format for compression. The data consists entirely of floating points so I decided to quantize the data to an intergers between 0 and 65535 so the data can be written as two bit unsigned integers and…
Zeeno
  • 2,671
  • 9
  • 37
  • 60
18
votes
3 answers

How should I replace vector::const_iterator in an API?

I've been given the task of polishing the interface of a codec library. We're using C++17, and I can only use the standard library (i.e. no Boost). Currently, there's a Decoder class that looks roughly like this: class Decoder : public Codec…
splicer
  • 5,344
  • 4
  • 42
  • 47
17
votes
8 answers

Are there any Java Frameworks for binary file parsing?

My problem is, that I want to parse binary files of different types with a generic parser which is implemented in JAVA. Maybe describing the file format with a configuration file which is read by the parser or creating Java classes which parse the…
Kosi2801
  • 22,222
  • 13
  • 38
  • 45