hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Sachin Shetty <sshe...@egnyte.com>
Subject writeTo called twice on custom InputStreamEntity class
Date Mon, 10 Feb 2014 21:07:13 GMT
Hi,

I have a a custom Entity stream class as below

public class GcsCustomInputStreamEntity extends InputStreamEntity {

            InputStream sourceStream - null;

           Public GcsCustomInputStreamEntity(InputStream sourceStream) {
             this.sourceStream = sourceStream
       }

    @Override

public boolean isStreaming() {

    return false;

}



    @Override

public boolean isRepeatable() {

return false;

}



  @Override

    public void writeTo(final OutputStream outstream) throws IOException {

        // Write to stream here

        // read from sourceStream and write to outstream

    }


}

Even though I am returning false to isStreaming and isRepeatable, Sometimes
I see writeTo sometimes called twice even after writing the whole stream in
the first call? I am totally  stuck here, can't figure out why would the
http client library call writeTo twice.

Thanks
Sachin





Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message