How did stanford raffles reach Singapore?

And why did he travel that way?