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