Exercises
Use the Decorator pattern in order to design and implement a stream encoder. The encoder should work with DataInputStreams. The encoding that should be performed is Rot-13, that is, characters that are read from the stream should be rotated by 13 places (“A” becomes “N”, “W” becomes “J” etc). Punctuation and numbers should remain unchanged. Use the encoder in order to encode and then decode the file “text.txt”. Hint: applying twice the encoding process, a Rot-13 encoded stream gets decoded.