Apply the logic for processing/writing all data of read/write buffer in
Encode/Decode methods.
Remove unnecessary throws declerations.
Add sources for CoreMessage encoding/decoding.
Refactor the implementation of message encode/decode.