Questions tagged [bit-packing]

Use this tag for questions related to bit packing, for example packing bits into integer types.

is used in its general concept, and is usually found in questions using C (or C based languages) or Java.

64 questions
0
votes
1 answer

Packing bits into longs server/client transaction in Java

Are there libraries to compress bits into longs? I am trying to compress bits that I send over a network. Would it make more sense to just put the bits in a png file and transfer that?
smuggledPancakes
  • 9,881
  • 20
  • 74
  • 113
-1
votes
1 answer

Unpack 16-bit integer values from a 64-bit field in MATLAB

I am reading data from an accelerometer, which provides the measurements for each of the 3 axes (x, y, and z) as 16-bit integers packed into a single 64-bit field. I have the following code in C to extract these 3 axis values: uint8_t byte0 =…
Power
  • 91
  • 8
-1
votes
3 answers

How to pack the required bits of a structure in a char*?

Language : C++ I am working on Bit Packing (Extracting the required bits from the given data and packing them in a char*) . My code currently supports : - Integers - Characters - Strings Now if I have to store the required bits of a structure,…
Aquarius_Girl
  • 21,790
  • 65
  • 230
  • 411
-1
votes
1 answer

Parsing a MAC Address to an array of three 16-bit shorts

MAC Addresses are 48 bits. That is equivalent to three shorts. MAC addresses are sometimes written like this: 01:23:45:67:89:ab where each pair of digits represents a hexadecimal number. Write a function that will take in a character pointer…
user4567366
1 2 3 4
5