Modified MessageInputStream to not inherit DataInputStream.
Added flag and logic to receive public key in MessageInputStream.