• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

could we ignore few lines from an BufferedReader input stream

 
Ranch Hand
Posts: 57
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi everyone,
is it possible to ignore few lines from
input stream and make the fourth line as the
start of the document.
i am working on reading an soap file. i
want to ignore HTTP messages from it and start
the document as XML to enable parsing.
are there any solution, so that my input
stream reads only xml messages and ignore the
HTTP messages,
Thanks in advance
 
Sheriff
Posts: 7001
6
Eclipse IDE Python C++ Debian Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The usual solution to this sort of problem is to just write a Reader which wraps whatever reader you are using, and eats the uninteresting lines when asked for the first one. Something like:

I'm not sure that just eating the first four lines is quite robust enough for your application, though. Are you sure that all SOAP sources will have exactly four lines of header to ignore ?
reply
    Bookmark Topic Watch Topic
  • New Topic