ResourceResponse

constructor(@NonNull inputStream: InputStream, @NonNull mimeType: String)

Constructs a resource response provided by the input stream.

Note: The MIME type should not include character encoding. For example a single value like the "text/html; charset=utf-8" is not supported, use just "text/html" as a mime type. This method defaults to "utf-8" charset, if you wish to use different charset, use ResourceResponse instead.

Parameters

inputStream

The input stream with the resource data.

mimeType

The MIME type of the resource, for example "text/html".


constructor(@NonNull inputStream: InputStream, @NonNull mimeType: String, @NonNull charset: String)

Constructs a resource response provided by the input stream.

Note: The MIME type should not include character encoding. For example a single value like the "text/html; charset=utf-8" is not supported, use just "text/html" as a mime type and specify the charset via ResourceResponse.

Use ResourceResponse for content that has no character encoding (such as image resources).

Parameters

inputStream

The input stream with the resource data.

mimeType

The MIME type of the resource, for example "text/html".

charset

The character encoding of the resource, for example "utf-8".


constructor(@NonNull dataProvider: DataProvider, @NonNull mimeType: String)

Constructs a resource response provided by the data provider.

Note: The MIME type should not include character encoding. For example a single value like the "text/html; charset=utf-8" is not supported, use just "text/html" as a mime type. This method defaults to "utf-8" charset, if you wish to use different charset, use ResourceResponse instead.

Parameters

dataProvider

The data provider with the resource data.

mimeType

The MIME type of the resource, for example "text/html".


constructor(@NonNull dataProvider: DataProvider, @NonNull mimeType: String, @NonNull charset: String)

Constructs a resource response provided by the data provider.

Note: The MIME type should not include character encoding. For example a single value like the "text/html; charset=utf-8" is not supported, use just "text/html" as a mime type and specify the charset via ResourceResponse.

Use ResourceResponse for content that has no character encoding (such as image resources).

Parameters

dataProvider

The data provider with the resource data.

mimeType

The MIME type of the resource, for example "text/html".

charset

The character encoding of the resource, for example "utf-8".