hi roland

the inputstream being passed to the constructor is not null. i've
checked this by stepping through the code.
the little loop i wrote (which was executed in place of the entity
constructor) was able to read the bytes from the stream with no problem
..

cheers
alessandro



-----Original Message-----
From: Roland Weber [mailto:[EMAIL PROTECTED] 
Sent: Friday, February 16, 2007 4:57 PM
To: HttpClient User Discussion
Subject: Re: IllegalStateException: Content must be set before entity is
written

Hello Alessandro,

> by reading the bytes from 'item.openStream()' in a loop and logging 
> the number of bytes processed i was able to verify that the 
> 'item.openStream()' correctly returns the file content.
> (i did this just befor the line where i would pass the stream to the
> entity)
> 
> the InputStreamRequestEntity's constructor seems to not be able to get

> the contents of the stream passed as argument ....?

It's not the constructor, but a private method called bufferContent():

            } catch (IOException e) {
                LOG.error(e.getMessage(), e);
                this.buffer = null;
                this.content = null;
                this.contentLength = 0;
            }

Do you see an IOException in the log? The constructor would throw an
IllegalArgumentException if the InputStream is null.

cheers,
  Roland



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to