[Haskell-cafe] Re: ANN: A triple of new packages for talking tothe
barsoap at web.de
Wed Jan 9 17:43:52 EST 2008
"David Roundy" <daveroundy at gmail.com> wrote:
> On Jan 9, 2008 10:10 AM, Dominic Steinitz
> <dominic.steinitz at blueyonder.co.uk> wrote:
> > Duncan Coutts <duncan.coutts <at> worc.ox.ac.uk> writes:
> > > The difficulty is in deciding what the api should be. Does it
> > > give you a real bitstream or only a byte aligned one? If I ask
> > > for 3 bits then 15 bytes what does it do? Does it assume I meant
> > > 3 bits, then pad to the next byte boundary and get 15 bytes, or
> > > does it mean get 15 bytes but at this 3 bit shift offset?
> > I'd suggest an aligned and unaligned api.
> > So the aligned api would get 3 bits and the 15 bytes would start
> > from the next byte boundary.
> > The unaligned api would get 3 bits and the 15 bytes (=15 x 8 bits)
> > would finish still with an offset of 3.
> Do you mean we'd have an unalignedGetBytes as well as getBytes (which
> would remain aligned)? That would make sense, but it would seem a bit
> heavy to duplicate all of the binary API.
getBytes per default unaligned and additionally snapToNextByte?
(c) this sig last receiving data processing entity. Inspect headers for
past copyright information. All rights reserved. Unauthorised copying,
hiring, renting, public performance and/or broadcasting of this
More information about the Haskell-Cafe