the length of a subbigstring in bstr starting at position pos and given optional length opt_len. This function does not check the validity of its arguments. Use check_args for that purpose.
Accessors for parsing binary values, analogous to Binary_packing
These are in Bigstring rather than a separate module because:
1. Existing Binary_packing requires copies and does not work with bigstrings. 2. The accessors rely on the implementation of bigstring, and hence should change should the implementation of bigstring move away from Bigarray. 3. Bigstring already has some external C functions, so it didn't require many changes to the jbuild ^_^.
In a departure from Binary_packing, the naming conventions are chosen to be close to C99 stdint types, as it's a more standard description and it is somewhat useful in making compact macros for the implementations. The accessor names contain endian-ness to allow for branch-free implementations
Similar to the usage in binary_packing, the below methods are treating the value being read (or written), as an ocaml immediate integer, as such it is actually 63 bits. If the user is confident that the range of values used in practice will not require 64-bit precision (i.e. Less than Max_Long), then we can avoid allocation and use an immediate. If the user is wrong, an exception will be thrown (for get).