Win a copy of Microservices Testing (Live Project) this week in the Spring forum!
  • 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
  • Tim Cooke
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Liutauras Vilda
  • Henry Wong
  • Devaka Cooray
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Al Hobbs
  • Carey Brown
Bartenders:
  • Piet Souris
  • Mikalai Zaikin
  • Himai Minh

duplicate inputstream

 
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,

my server side code is reading inputstream from client.
This inputstream i am passing to saxparser.
Saxparser is able to parse the document, its working fine.

my client may get disconnected. so i have to start resending the complete file to server again.

Instead i want to create a temp file and same time i want to send the inputstream to Saxparser. is this possible ?

hope got my question.

I want to do this so that i can save the transmission time from client to server. if client gets disconnected i only send the remaining part of the file.

Thanks in advance..
Kotesh.
 
Bartender
Posts: 9626
16
Mac OS X Linux Windows
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You are talking about two different problems: First, you want functionality similar to the unix command tee, where you split an input stream. That's easy. Read from an input stream and write the same data to two output streams. Second, you want to have a file upload resume capability. That's a bit more complex because you need some way to tell the client where to resume the upload.
If I were you I'd concentrate on the file upload resume and just send the file, when complete to the parser (if that fits with your program requirements).
 
kotesh rao
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Resuming file upload is ok. I am able to handle it.

what u said is correct..once the file is complete we send to saxparser to parse it.

but my problem is, its taking lot of time..
1. to get the file from client say 10mins then
2. to parse the file again 10mins. total - 20mins.(approx double the time)

other way..which i want to do.
write the stream to file and also pass stream to parser both at a time.

ya i want to do 2 things....so that server can respond fastly to user.

Kotesh.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic