Method for transferring a stream of at least one data packet between first and second electronic devices and corresponding device