473,383 Members | 1,862 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,383 software developers and data experts.

BufferedOutputStream do not write all byte array in linked OutputStream

Hello,
I am writing a proxy.When a proxy works like transparent
"clientOut.write(response, 0, responseLength);"
clientOut is
"BufferedOutputStream clientOut = new BufferedOutputStream(pSocket.getOutputStream());"
All is works right,but when I change response array
"responseProxy = modi_content(response,word,color);"
"modi_content" is a function, who change original response.
After that, I want to write modified response in client stream
"clientOut.write(responseProxy, 0, responseProxy.length);".
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.
May 15 '07 #1
3 2916
JosAH
11,448 Expert 8TB
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 BufferedOutputStream (just a wild guess though).

kind regards,

Jos
May 15 '07 #2
I found it.
I did not change a Content-Length in the header.
Thanks
May 16 '07 #3
JosAH
11,448 Expert 8TB
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
May 16 '07 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

1
by: Richard | last post by:
I'm working on a site that creates mailing labels. When a label is generated, two things happen in the background with the image. First, it is saved as a smaller low-quality .gif on the server...
3
by: Richard | last post by:
I'm working on a site that creates mailing labels. When a label is generated, two things happen in the background with the image. First, it is saved as a smaller low-quality .gif on the server...
5
by: Rob Nelder | last post by:
I’m attempting to stream a PDF to the browser so that the user will get the appearance of just opening the PDF in Explorer. The PDF is being generated by the SQL Server Reporting Services web...
5
by: philip | last post by:
Here is some lines of code than I wrote. You can copy/paste theis code as code of form1 in a new project. My problem is this one : I try to write in a file a serie of bytes. BUT some bytes...
2
by: PrePort | last post by:
The goal here is to return a dynamic image from an HttpHandler that I have written. 2 questions 1. I am reading the images into byte fine and cacheing them fine, but what should I use to deliver...
3
by: broli85 | last post by:
I am writing an extension for Firefox 1.5. I would like to know if there is a way to write and read data to and from a file which is in the location of the extension (or somewhere in the user's...
1
by: Jon Paal | last post by:
need help with code to encrypt a string and write it out to a file. code does not write out to file =========code============== Private Shared ReadOnly encryptionKeyBytes() As Byte = New...
1
by: stmfc | last post by:
generally i see that BufferedOutputStream objects are wrapped with DataOutputStream, what is the reason for this design? why do coders prefer this style instead of doing operations on...
4
by: AAaron123 | last post by:
trying to understand the below shown code. After this is run the browser opens a file-save dialog box for saving the file. I wonder how it knows I want the file saved? But more important, the...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.