A MessageParser is to read a message string from a given input stream and then parse
the message string to convert it to the certain message format.
Each MessageParser is assigned a certain socket as its data input stream.
The MessageParser reads the input data from that socket, the input data is a string.
The MessageParser then parses this string according to the specified message format
to get the value of each field in the string and stores this information in a certain
Message type.
MessageParser has three methods: SetInputStream, getNextMessage, and readMessageString.
SetInputStream(DataInputStream): Assign the parameter DataInputStream to be the input stream of this MessageParser.
getNextMessage(): This method first reads the message string, and then parses it and converts it to a Message.
readMessageString(): This method is to get the complete message string from the assigned
input stream.