If you look at the implementations of any of the BinInputStream
derivatives, you'll see that they simply return 0 from readBytes() to
signal the end-of-stream condition.

By the way, you should be prepared for readBytes() to be called once more
after having returned 0 the first time.  At least that's been my
experience.

Dave



                                                                                       
                        
                      "Coursimault,                                                    
                        
                      Jean-marc"                To:      
"'[EMAIL PROTECTED]'"                       
                      <Coursimault@xrce         <[EMAIL PROTECTED]>          
                        
                      .xerox.com>               cc:      (bcc: David N 
Bertoni/CAM/Lotus)                      
                                                Subject: RE: Incremental /progressive 
parsing                  
                      12/05/2001 11:58                                                 
                        
                      AM                                                               
                        
                      Please respond to                                                
                        
                      xerces-c-dev                                                     
                        
                                                                                       
                        
                                                                                       
                        



Hello,
I need to give the input data one buffer at a time to Xerces.
I don't know in advance the length of the input data.
I cannot give it all at once to Xerces either.

I was thinking of deriving a "MyInputStream" from a BinInputStream and
getting the data inside readBytes, but what is the "right" way to signal
the
end of the data ?

By returning 0 from readBytes (which is the length of available data, I
gather) ? or by throwing an exception ?

Thanks
-- Jean-Marc
____________________________________________________________
Jean-Marc Coursimault         |
Xerox Research Centre Europe  | Tel   +33 (0)4 76 61 51 82
Advanced Technology & Systems | Mob.  +33 (0)6 12 39 65 12
6, chemin de Maupertuis       | Fax   +33 (0)4 76 61 51 99
38240 Meylan (France)         | mail : [EMAIL PROTECTED]


>> My application can only provide a buffer at a time to Xerces,
>> not a whole
>> file neither a buffer containing the whole document.
>> How can I feed Xerces that way (as in expat, XML_parse() does ?)
>> ==>expat :
>> ==>XML_Parse(XML_Parser p,const char *s,int len, int isFinal)
>> ==>Parse some more of the document.
>> ==>The string s is a buffer containing part (or perhaps all) of the
>> document.
>>
>> I don't see anyhting suitable in the API doc

> From: Erik Rydgren [mailto:[EMAIL PROTECTED]]

> In the YourInputStream::ReadBytes method let WT wait for data
> from the main thread.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]






---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to