473,757 Members | 6,899 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

BufferedOutputS tream do not write all byte array in linked OutputStream

4 New Member
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.
May 15 '07 #1
3 2931
JosAH
11,448 Recognized Expert MVP
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
May 15 '07 #2
danibangelov
4 New Member
I found it.
I did not change a Content-Length in the header.
Thanks
May 16 '07 #3
JosAH
11,448 Recognized Expert MVP
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
3140
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 and then presented as a preview using an img tag (also later used for a history feature on the site). Second, when the user clicks on the image, a new window appears with only the mailing label as a high-quality .png graphic. I don't save the...
3
3221
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 and then presented as a preview using an img tag (also later used for a history feature on the site). Second, when the user clicks on the image, a new window appears with only the mailing label as a high-quality .png graphic. I don't save the...
5
4084
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 service as a byte array (I’ve already checked that this is working as expected). My problem is that Explorer just loads a blank page, and reports “Done” in the status bar. If I hit Refresh, it prompts me to “resend the information”, on...
5
3661
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 written in file are not the sent bytes. Copy and paste the following lines to observe my problem. What can I do to resolve problem ? Only System.Text.Encoding.ASCII write the same number of bytes, but not the good bytes. Someone can help me. Thanks by...
2
8378
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 the image to the client? My code: context.Response.ContentType = "image/gif"; context.Response.Cache.SetCacheability(HttpCacheability.NoCache); context.Response.Cache.SetNoStore();
3
8836
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 harddisk, where I can store and retrieve some data). I tried to use a write function which I found in one of these threads and tried to give it "chrome://followmylink/files/" as the path. function fileWriter (filename,content) { try { var...
1
932
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 Byte() {53, 53, 53, 53, 53, 53, 53, 53} Private Shared Function GenerateEncryptedLicFile(ByVal inputText As String, ByVal outputFile As String) As Boolean Dim outputStream As Stream = Nothing Dim encryptedStream As Stream = Nothing
1
17653
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 BufferedOutputStream objects. i am newbie to java, i will appreciate if the explanation is clear enough for a beginner to understand e.g: DataOutputStream out2 = new DataOutputStream( new BufferedOutputStream(new FileOutputStream("Data.txt")) );
4
11954
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 dialog box has as the default file name the name of this ashx file. I'd like to make that name more meaningfull but don't know how it gets set. I'm looking for a Response.Write but don't find one. Maybe that why the
0
9489
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, well explore What is ONU, What Is Router, ONU & Routers main usage, and What is the difference between ONU and Router. Lets take a closer look ! Part I. Meaning of...
0
10072
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9906
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
7286
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupr who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6562
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5172
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5329
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
3
3399
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2698
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.