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

How do I start reading at an offset in binary data?

I have a C-like struct like this: SomeStruct << BinData::Record endian :little uint32 :offsetOfName uint32 :offsetOfLastname #... uint32 :lenVars struct :Person, :length => :lenVars string :name string :lname #... end I have a bunch of…
omninonsense
  • 6,644
  • 9
  • 45
  • 66
6
votes
4 answers

c# Detect xml encoding from Byte Array?

Well i have a byte array, and i know its a xml serilized object in the byte array is there any way to get the encoding from it? Im not going to deserilize it but im saving it in a xml field on a sql server... so i need to convert it to a string?
Peter
  • 37,042
  • 39
  • 142
  • 198
6
votes
3 answers

Is there any C# framework or code to parse *blg Perfomance Counter log files?

The task is not to gather Performance counters data in my .NET app, but open already prepared binary log files (*.blg)? I know that MS SQL Profiler (.NET app) can parse binary logs.
skaeff
  • 753
  • 2
  • 13
  • 25
6
votes
4 answers

Is there any perfomormance differences between binary and XML serialization?

in terms of both parsing (serializing, deserializing) and sending packets over the network is there any good estimation of performance differences between binary and xml serialization?
leora
  • 188,729
  • 360
  • 878
  • 1,366
6
votes
1 answer

Reading/writing/copying an ArrayBuffer into another ArrayBuffer with an offset

Let's say I have an ArrayBuffer which is an mp4 file. I'd like to create a new ArrayBuffer with a few extra bytes to be used as header information, and then store the mp4 buffer in the remainder of the new ArrayBuffer. // ... assume the `data`…
Nick Jennings
  • 3,853
  • 6
  • 30
  • 45
6
votes
1 answer

How to process large binary data in Clojure?

How does one process large binary data files in Clojure? Let's assume data/files are about 50MB - small enough to be processed in memory (but not with a naive implementation). The following code correctly removes ^M from small files but it throws…
qertoip
  • 1,870
  • 1
  • 17
  • 29
6
votes
1 answer

Why does PHP substr() change ASCII carriage return byte?

I was going to use a long string to manipulate a large number of bit flags, keeping the result string in Redis. However, stumbled upon a php bug (?). A byte that contains bits 00001101 read using substr() returns an unexpected value: $bin =…
Serge
  • 1,531
  • 2
  • 21
  • 44
6
votes
3 answers

Read in 4-byte words from binary file in Julia

I have a simple binary file that contains 32-bit floats adjacent to each other. Using Julia, I would like to read each number (i.e. each 32-bit word) and put them each sequentially into a array of Float32 format. I've tried a few different things…
William
  • 521
  • 7
  • 21
6
votes
1 answer

Saving and retreving photos and videos in Parse (Android)

I was looking at the Parse Android docs and saw that to save photos and videos, you have to initialize a new ParseFile with a name and a byte[] of data and save it. What's the easiest way to convert an image Uri and video Uri to a byte array? Here…
lschlessinger
  • 1,934
  • 3
  • 25
  • 47
6
votes
1 answer

Most efficient way (time and space wise) to send binary data in response

My setup is a Flask-based server. A bird-view of the project would be: the Flask-based server fetches binary data from AWS S3 based on some algorithmic calculations (like figuring out the filenames to fetch from S3), and serves the data to an…
bhootjb
  • 1,501
  • 1
  • 21
  • 33
6
votes
2 answers

Problems in writing binary data with node.js

I am trying to write the binary body of a request to a file and failing. The file is created on server but I am unable to open it. I am getting 'Fatal error: Not a png' on Ubuntu. Here is how I am making the request: curl --request POST…
Akash
  • 5,153
  • 3
  • 26
  • 42
6
votes
4 answers

How to convert binary string to the byte array of 2 bytes in java

I have binary string String A = "1000000110101110". I want to convert this string into byte array of length 2 in java I have taken the help of this link I have tried to convert it into byte by various ways I have converted that string into decimal…
rachana
  • 3,344
  • 7
  • 30
  • 49
6
votes
4 answers

Overcoming .NET problem of displaying binary columns in a DataGridView

If a DataSet contains a column that is a timestamp or other binary value, its associated DataGridView throws an ArgumentException, when displaying any data in that column. That is, assume you have some table containing a binary column such…
Michael Sorens
  • 35,361
  • 26
  • 116
  • 172
6
votes
3 answers

Print string with null character in java

I have string which contains null character ie \0. How can I print the whole string in java? String s = new String("abc\u0000def"); System.out.println(s.length()); System.out.println(s); Output on eclipse console: 7 abc Length is that of complete…
user517491
6
votes
1 answer

Receiving binary data via HTTP in Go

What's the best way to go about receiving binary data via HTTP in go? In my case, I'd like to send a zip file to my application's REST API. Examples specific to goweb would be great, but net/http is fine too.
cmhobbs
  • 2,469
  • 3
  • 24
  • 30