Interface HttpContent (1.41.8)

public interface HttpContent extends StreamingContent

Serializes HTTP request content into an output stream.

Implementations don't need to be thread-safe.

Implements

StreamingContent

Methods

getLength()

public abstract long getLength()

Returns the content length or less than zero if not known.

Returns
TypeDescription
long
Exceptions
TypeDescription
IOException

getType()

public abstract String getType()

Returns the content type or null for none.

Returns
TypeDescription
String

retrySupported()

public abstract boolean retrySupported()

Returns whether or not retry is supported on this content type.

Returns
TypeDescription
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.

Parameter
NameDescription
outOutputStream
Exceptions
TypeDescription
IOException