Well, is trans a string variable, a file with characters, a char pointer, etc?
Here's a quick decode example from an encoded file to a decoded file. Decoding is just subtracting one from the character, which had one added when encoded. The decoding and writing to a file is one operation here.
Code:
while (fileIn2.get(ch)) // Decrypt data
fileOut2.put(ch - 1);
fs.put may be reading in one character at a time, but you may be trying to give it a string. You may need a loop or different variable type for trans.