pub fn decode<T: AsRef<str>>(message: T) -> BasicMessage {
    let (buffer, bit_length) = decode_from_hexadecimal(message);
    //let buffer = from_hex(message);
    //let bit_length = buffer.len() * BYTE;

    let mut bit_cursor = 0;
    //let mut next_field = 0;

    let mut header: MessageSegment = MessageSegment::generic_header_segment();
    bit_cursor += header.decode(&buffer, bit_length, bit_cursor, 0); // header.bit_length();

    let message_type = get_message_type(&header);

    let mut body = message_type.body.clone();
    body.decode(&buffer, bit_length, bit_cursor, 0);
    //bit_cursor += header.bit_length();
    //next_field = body.fields.len();

    //body.decode(&buffer, bit_length, bit_cursor, next_field);

    BasicMessage::new(message_type, header, body)
}
/**
 * Decodes an encoded Whiteflag message and creates a new Whiteflag base message object
 * @since 1.1
 * @param msgBuffer a buffer with the compressed binary encoded message
 * @return this message creator
 * @throws WfCoreException if the encoded message is invalid
 */
Decodes an encoded Whiteflag message and creates a new Whiteflag base message object
@since 1.1
@param msgBuffer a buffer with the compressed binary encoded message
@return this message creator
@throws WfCoreException if the encoded message is invalid
Decodes an encoded Whiteflag message and creates a new Whiteflag base message object @since 1 . 1 @param msgBuffer a buffer with the compressed binary encoded message @return this message creator @throws WfCoreException if the encoded message is invalid
pub fn decode<T: AsRef<str>>(message: T) -> BasicMessage {
    let (buffer, bit_length) = decode_from_hexadecimal(message);
    //let buffer = from_hex(message);
    //let bit_length = buffer.len() * BYTE;
    let mut bit_cursor = 0;
    //let mut next_field = 0;
    let mut header: MessageSegment = MessageSegment::generic_header_segment();
    bit_cursor += header.decode(&buffer, bit_length, bit_cursor, 0); // header.bit_length();
    let message_type = get_message_type(&header);
    let mut body = message_type.body.clone();
    body.decode(&buffer, bit_length, bit_cursor, 0);
    //bit_cursor += header.bit_length();
    //next_field = body.fields.len();
    //body.decode(&buffer, bit_length, bit_cursor, next_field);
    BasicMessage::new(message_type, header, body)
}
pub fn decode < T : AsRef < str > > ( message : T ) -> BasicMessage { let ( buffer , bit_length ) = decode_from_hexadecimal ( message ) ; //let buffer = from_hex(message); //let bit_length = buffer.len() * BYTE; let mut bit_cursor = 0 ; //let mut next_field = 0; let mut header : MessageSegment = MessageSegment :: generic_header_segment ( ) ; bit_cursor += header . decode ( & buffer , bit_length , bit_cursor , 0 ) ; // header.bit_length(); let message_type = get_message_type ( & header ) ; let mut body = message_type . body . clone ( ) ; body . decode ( & buffer , bit_length , bit_cursor , 0 ) ; //bit_cursor += header.bit_length(); //next_field = body.fields.len(); //body.decode(&buffer, bit_length, bit_cursor, next_field); BasicMessage :: new ( message_type , header , body ) }
Decodes an encoded Whiteflag message and creates a new Whiteflag base message object
 @since 1.1
 @param msgBuffer a buffer with the compressed binary encoded message
 @return this message creator
 @throws WfCoreException if the encoded message is invalid
Decodes an encoded Whiteflag message and creates a new Whiteflag base message object @since 1 . 1 @param msgBuffer a buffer with the compressed binary encoded message @return this message creator @throws WfCoreException if the encoded message is invalid
message
T
message
T