Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Java > problem read ServletInputStream

Reply
Thread Tools

problem read ServletInputStream

 
 
AlexF
Guest
Posts: n/a
 
      12-05-2006
Hi,

I didn't find the answer at group content.
May be anybody knows how to solve this problem?

I use HTTPS connection and servlet receives XML to parse.

With JDK1.4 was no problem with reading ServletInputStream:

ServletInputStream inputStream = request.getInputStream();
lw.info("After Get Input Stream.");
ByteArrayOutputStream uploadBuffer = new
ByteArrayOutputStream();

int count;
byte[] buff = new byte[2048];
lw.info("Start reading from buffer");
while ((count = inputStream.read(buff)) != -1) {
uploadBuffer.write(buff, 0, count);
}
lw.info("End reading from buffer");
inputStream.close();
uploadBuffer.close();
req = new String(uploadBuffer.toByteArray());

The same code compiled with JDK1.5 returns empty request - at first
read the return value is -1.
I've tried all read(..) methods but without unsucceed.

Please, help to solve the problem.

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Closing ServletInputStream adblock Java 7 01-31-2008 03:55 PM
Help: Program to read from EOR end of last read? snoopy_@excite.com Java 3 04-07-2006 12:32 PM
Binary data stored in SQL Server: can't read from ASP.NET, *can* read from Access? Doug ASP .Net 3 11-04-2005 07:35 PM
ServletInputStream - reads slowly in larger stream of data Suresh Java 0 09-21-2005 08:14 AM
Re: How to change Read Only Constraint to Read-Write Isaac VHDL 0 07-10-2003 01:43 PM



Advertisments