BufferedOutputStream do not write all byte array in linked OutputStream

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • danibangelov
    New Member
    • May 2007
    • 4

    BufferedOutputStream do not write all byte array in linked OutputStream

    Hello,
    I am writing a proxy.When a proxy works like transparent
    "clientOut.writ e(response, 0, responseLength) ;"
    clientOut is
    "BufferedOutput Stream clientOut = new BufferedOutputS tream(pSocket.g etOutputStream( ));"
    All is works right,but when I change response array
    "responsePr oxy = modi_content(re sponse,word,col or);"
    "modi_conte nt" is a function, who change original response.
    After that, I want to write modified response in client stream
    "clientOut.writ e(responseProxy , 0, responseProxy.l ength);".
    The result is that, not all bytes from responseProxy are wrote in OutputStream and
    the web page have no all source code and desplays incorrect in browser.
    Do you have any ideas, where I make mistake and who is that mistake.
    Thank you.
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    From the snippets you've shown us we can't deduce the error; you have to show
    a bit more of the relevant code. Without seeing your code you could try to
    flush the BufferedOutputS tream (just a wild guess though).

    kind regards,

    Jos

    Comment

    • danibangelov
      New Member
      • May 2007
      • 4

      #3
      I found it.
      I did not change a Content-Length in the header.
      Thanks

      Comment

      • JosAH
        Recognized Expert MVP
        • Mar 2007
        • 11453

        #4
        Originally posted by danibangelov
        I found it.
        I did not change a Content-Length in the header.
        Thanks
        Good to read; success with the rest of your program.

        kind regards,

        Jos

        Comment

        Working...