Welcome to the Java Programming Forums


The professional, friendly Java community. 21,500 members and growing!


The Java Programming Forums are a community of Java programmers from all around the World. Our members have a wide range of skills and they all have one thing in common: A passion to learn and code Java. We invite beginner Java programmers right through to Java professionals to post here and share your knowledge. Become a part of the community, help others, expand your knowledge of Java and enjoy talking with like minded people. Registration is quick and best of all free. We look forward to meeting you.


>> REGISTER NOW TO START POSTING


Members have full access to the forums. Advertisements are removed for registered users.

Results 1 to 1 of 1

Thread: Efficiently processing data ....

  1. #1
    Junior Member
    Join Date
    Jul 2012
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default Efficiently processing data ....

    Dear experts,

    I'm looking for a way to efficiently process data using a Servlet Filter. I have come up with the following solution


    class PipedWrapper - ServletResponseWrapper wraps a PipedOutputStream ...
    class Consumer - This class connects PipedOutputStream to a PipedInputStream. The PipedInputStream writes out the content to the ServletOutputStream ...
    The code runs in a separate thread and awaits for the data that is written via the PipedOutputStream via PipedWrapper

    This does seem to work. I do see the data coming via the PipedOutputStream to the PipedInputStream and it is exactly the data that I have written out in the servlet.
    But as soon as I try to write out the data to the ServletOutputStream, it fails. Well I don't see an error, but I also don't see any output.

    My question to you is: is it possible to write out data via a separate thread or are there known limitations?

    I have included an example to give you an idea.
    Attached Files Attached Files


Similar Threads

  1. Replies: 1
    Last Post: April 9th, 2012, 05:13 PM
  2. Using arrays more efficiently in Java?
    By mjballa in forum Java Theory & Questions
    Replies: 1
    Last Post: February 4th, 2012, 08:53 PM
  3. Replies: 2
    Last Post: January 6th, 2012, 10:50 PM
  4. Processing
    By KevinWorkman in forum Other Programming Languages
    Replies: 4
    Last Post: September 6th, 2011, 10:30 AM
  5. Replies: 1
    Last Post: June 11th, 2011, 05:39 AM