public interface HttpContent extends StreamingContent
Serializes HTTP request content into an output stream.
Implementations don't need to be thread-safe.
Implements
StreamingContentMethods
getLength()
public abstract long getLength()
Returns the content length or less than zero if not known.
Type | Description |
long |
Type | Description |
IOException |
getType()
public abstract String getType()
Returns the content type or null
for none.
Type | Description |
String |
retrySupported()
public abstract boolean retrySupported()
Returns whether or not retry is supported on this content type.
Type | Description |
boolean |
writeTo(OutputStream out)
public abstract void writeTo(OutputStream out)
Writes the byte content to the given output stream.
Implementations must not close the output stream, and instead should flush the output stream. Some callers may assume that the output stream has not been closed, and will fail to work if it has been closed.
Name | Description |
out | OutputStream |
Type | Description |
IOException |