Added getMessageLength method to get length of byte array in object