code: def codes_write(handle, outfile):
      # type: (cffi.FFI.CData, T.BinaryIO) -> None
      
      mess = ffi.new('const void **')
      mess_len = ffi.new('size_t*')
      codes_get_message = check_return(lib.codes_get_message)
      codes_get_message(handle, mess, mess_len)
      message = ffi.buffer(mess[0], size=mess_len[0])
      outfile.write(message)
docs: Write a coded message to a file. If the file does not exist, it is created.
  
      :param str path: (optional) the path to the GRIB file;
          defaults to the one of the open index.