How do you speak Pig Latin?

Im slightly confused when learning to speak pig latin. I don't get it! Maybe if some people help me out, then I'll get it!

Please Help Me!

How do you talk pig latin .?

All my friends talk pig latin.And im the only one who dose not know how to its so hard.

How does a person speak pig latin?

I wanna speak pig latin PROPERLY!

Can anybody teach me how to speak pig latin?

all i know is : ouyay areyay upidstay. Somebody said that to me and said that it meant that I'm smart. Is that right? How do i learn how to speak it?
By the way, are pigs rodents? I didn't know what category to put it in because I don't know what pigs are. Does speaking pig latin actually work for talking to pet pigs?
Oh. I thought pigs were rodents because a guinea pig is a rodent.

I'm trying to write an encoding program on Java. What I would like to do is take a text file, and each word in that text file will be turned into Pig Latin. That means that the first letter of the word goes to the back and then an "ay" is added on. For example: Pig Latin would become Igpay Atinlay. I already know how to create text files on Java, so I want to take that text file and turn it into Pig Latin.