let read_int str offset =
  try int_of_string (String.sub str offset 4)
  with Failure _ -> -1