then i read one message object from the queue using the call
ByteMsg = Queuereceiver.recieve()
now is it possible for me to know how many bytes are present in this
BytesMessage object so that i can allocate a byte array for reading all
the
data in to this byte array ?
The bad news:
no - it was something of an oversight from the JMS 1.0.2 spec.
The good news:
a call has been added to the JMS 1.1 spec for this purpose.
Until then, I'm afraid you have to choose between a few different work arounds:
a) Use fixed length messages
b) Use a different message type
c) Use a user property to carry the size of the message body
d) guess the buffer size, loop until the number of bytes read is less than the size of the buffer provided (implying an extra level of array copy operations to build the output array you really want)
(Yes, I know a, b and even c are likely to be inapplicable in some situations.)
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum