468,505 Members | 2,006 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 468,505 developers. It's quick & easy.

Bitstream type of class

PSN
hello everyone,
Can someone suggest me what would be the best way to build something
like a bitstream class that allows me to do all sorts of bit
operations, same as the bitstream and also whole other custom
operations.

Thanks for your time,

PSN
Dec 12 '07 #1
1 5072
On Dec 12, 4:30 am, PSN <prakash...@gmail.comwrote:
hello everyone,
Can someone suggest me what would be the best way to build something
like a bitstream class that allows me to do all sorts of bit
operations, same as the bitstream and also whole other custom
operations.

Thanks for your time,

PSN

There's the std::bitset<size_t NumberOfBitsalthough its not a
"stream" but more like a container (set of flags). It does however
have all sorts of overloads for operating on bits.

If its a "byte stream" your after, then std::streambuf could be used
(but be warned if want the bytestream to be portable, streambuf does
not care of things such as endianess).

HTH,
Chris

Dec 13 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

6 posts views Thread by Dietrich Epp | last post: by
3 posts views Thread by Steve Brown | last post: by
5 posts views Thread by Fabio Fracassi | last post: by
16 posts views Thread by Dennis | last post: by
1 post views Thread by gangesmaster | last post: by
5 posts views Thread by JH | last post: by
21 posts views Thread by Nikolaus Rath | last post: by
reply views Thread by NPC403 | last post: by
3 posts views Thread by gieforce | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.