On Tue, 2019-05-21 at 18:22 +0000, Boris-Barboris via Digitalmars-d-learn wrote: […] > > Never used it myself, but BitArray with careful handling of > endianess might fit your task. > > https://dlang.org/phobos/std_bitmanip.html#.BitArray.this.2 > https://dlang.org/phobos/std_bitmanip.html#.peek
I'll have to mull that one over. The incoming data is a sequence of bytes that is treated as a bitfield. Although the standard says "big-endian" it is isn't entirely clear how this relates to the bitfields, I guess I need to read the standard more. :-( I guess the question is whether BitArray can work with bytes rather than size_t as elements of the backing array. -- Russel. =========================================== Dr Russel Winder t: +44 20 7585 2200 41 Buckmaster Road m: +44 7770 465 077 London SW11 1EN, UK w: www.russel.org.uk
signature.asc
Description: This is a digitally signed message part