Apply the logic for processing/writing all data of read/write buffer in
Encode/Decode methods.
Remove unnecessary throws declerations.