Moved read and write methods to connection class to make use of them in messagehandler for the user as well.