[Beepcore-java-users] reading message content split over multiple frames
Status: Beta
Brought to you by:
huston
|
From: Toby M. <tob...@cs...> - 2003-04-07 06:36:10
|
Hi all, I'm having trouble reading message content which is split over multiple BEEP frames. I'm using the IDXP infrastructure built on top of beepcore-java. When receiving messages, and using the InputDataStreamAdapter class to read the data, I am only getting access to the data which is in the first frame of the message. During the IDXP processing of messages, the message type is checked and the content header is examined to determine the message content. For octet-stream and text/plain messages, no other processing occurs before my app. gets access to the message. My application simply gets the InputDataStreamAdapter, creates an array big enough to hold the number of bytes available in the InputDataStreamAdapter, and reads the bytes into that array. The number of bytes returned by the available() method is only the count of hte payload for the first frame of what is a multi-frame message. Can anyone give me some help here? The strange part is, when trying to read the data using BufferSegments from the InputDataStream class, when I ask for the first buffersegment (using waitForNextBufferSegment()) I'm actually given the remainder of the message - ie. the part I can't read using InputDataStreamAdapter class. What is hte proper way to be using the BufferSegments / InputDataStreamAdapter classes to read the contents of messages? And does it matter that the getInputStream method has already been called in the InputDataStream associated with the message, before my code gets access to it? Thanks Toby |