let get_substr buf off len =
      (if
         (off < 0) ||
           ((len < 0) || (off > ((Bigarray.Array1.dim buf) - len)))
       then raise (Invalid_argument "index out of bounds")
       else ();
       unsafe_get_substr buf off len)