# About the spaces between bits

Let's say I have three functions and each gives true/false answers. The first one gives 2 booleans, the second 6 and third 4. Are they written like this: 01 110010 1000? Do they get spaces between the functions? If so, do the spaces count as data? What I wanna know is, if you send an encryption key using RSA, how does RSA recognize the length of your key with the spaces? Another way to put it is if a symmetric key has 256 functions of one bit each (0 1 1 0 0 1 0, etc.) would it end up being 512 bits long because of the spaces?

I'm new in computer science and I'm learning for fun by myself. I apologize if my question is the smh type.

Let's consider a more generic situation, in which you want to serialize (convert to bits) a sequence of values $x_1,\ldots,x_k$. If you know ahead of time what the length of $x_i$ is, then the most efficient encoding would be to put together all the bits of all values (no spaces!). (In practice, we also need to pack them into bytes, since data is passed around in byte chunks.)
If you don't know the length in advance, then there are several option. One option is to use some self-terminating encoding. For example, you could preface each bit by 0, and end the stream by a 1. A 2-bit string $b_0b_1$ would be encoded by $0b_00b_11$. Such an encoding is not very common. Another option is to store the length somewhere — this is quite common. For example, JPEG files store the dimension of the picture in a header. A third option is that the length, while not predetermined, is one of very few options. In that case it suffices to store just the index of the option in some header. This is probably what happens in cryptographic protocols.