/// <summary> Extract a byte array from the given BytesMessage.</summary>
 /// <param name="message">the message to convert
 /// </param>
 /// <returns> the resulting byte array
 /// </returns>
 /// <throws>  EMSException if thrown by EMS methods </throws>
 protected virtual byte[] ExtractByteArrayFromMessage(BytesMessage message)
 {
     byte[] bytes = new byte[(int)message.BodyLength];
     message.ReadBytes(bytes);
     return bytes;
 }