OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

How to store binary data (in the form of 0s and 1s) as a set of 8 0s and 1s as 1 byte each into a file

  • Thread starter Thread starter Musharraf Abdullah
  • Start date Start date
M

Musharraf Abdullah

Guest
I have a string of 0s and 1s. I want to take groups of 8 of these digits and assume them as a single byte and write it into a file to save as much space as possible. How should I encode this so that each group of binary string takes exactly 1 byte

I have tried using utf-8 and utf-16 ASCII but I am not able to successfully convert string to encoded characters
<p>I have a string of 0s and 1s. I want to take groups of 8 of these digits and assume them as a single byte and write it into a file to save as much space as possible. How should I encode this so that each group of binary string takes exactly 1 byte</p>
<p>I have tried using utf-8 and utf-16 ASCII but I am not able to successfully convert string to encoded characters</p>
 

Latest posts

M
Replies
0
Views
1
Meliodas Dragon
M
Top