Ocaml-bitstring doesn't support stream
GoogleCodeExporter opened this issue · comments
Google Code Exporter commented
Hi !
For our project (liquidsoap), we have tested ocaml-bitstring, and we find
it really really good !
However, in order to use it in our project, we would like to be able to
treat streamed data, which doesn't seem possible at the moment.
Could ocaml-bitstring be extended to support streamed data ?
Original issue reported on code.google.com by romain.b...@gmail.com
on 5 Aug 2008 at 11:00
Google Code Exporter commented
[This is what I wrote in a private email back to the reporter]
Second issue - bitstrings from streams. I guess I'm interested to
know what your approach will be. Clearly we don't want to make the
current bitstrings-as-strings impl slower by adding any indirection.
Also I have another, related requirement: bitstrings from arbitrary
sources. I'm very interested in parsing bitstrings where the
bitstring is loaded on-demand from some external resource, ie. from
virtual machine memory or disk image. This would involve calling some
arbitrary function when we need to load data. Something like this:
let f start size =
load_virtual_memory start size
in
let bits = Bitstring.bitstring_of_external f in
bitmatch bits with
| { ... } -> (* f is called on-demand to load new data as required *)
but not exactly like that because we usually also need to jump to
large offsets within the memory / disk image, and also to follow
pointers to other structures. I'm afraid I don't have a precise idea
about the best interface to this.
Original comment by richard....@gmail.com
on 20 Aug 2008 at 5:01
- Changed state: Accepted
- Added labels: Type-Enhancement
- Removed labels: Type-Defect
Google Code Exporter commented
Discussion of this enhancement continues on the mailing list:
http://groups.google.com/group/bitstring
Original comment by richard....@gmail.com
on 22 Aug 2008 at 6:57