in src/main/csharp/MessageConsumer.cs [138:159]
public IMessage Receive(TimeSpan timeout)
{
int size;
byte[] receivedMsg = this.destination.ReceiveBytes(timeout, out size);
if(size > 0)
{
// Strip off the subscribed destination name.
int receivedMsgIndex = this.destination.rawDestinationName.Length;
int msgLength = receivedMsg.Length - receivedMsgIndex;
byte[] msgContent = new byte[msgLength];
for(int index = 0; index < msgLength; index++, receivedMsgIndex++)
{
msgContent[index] = receivedMsg[receivedMsgIndex];
}
return ToNmsMessage(msgContent);
}
return null;
}