ktor-http / io.ktor.http.content / OutgoingContent / ReadChannelContent

ReadChannelContent

abstract class ReadChannelContent : OutgoingContent

Variant of a OutgoingContent with payload read from ByteReadChannel

Constructors

<init>

ReadChannelContent()

Variant of a OutgoingContent with payload read from ByteReadChannel

Inherited Properties

contentLength

open val contentLength: Long?

Specifies content length in bytes for this resource.

contentType

open val contentType: ContentType?

Specifies ContentType for this resource.

headers

open val headers: Headers

Headers to set when sending this content

status

open val status: HttpStatusCode?

Status code to set when sending this content

Functions

readFrom

abstract fun readFrom(): ByteReadChannel

Provides ByteReadChannel for the content

open fun readFrom(range: LongRange): ByteReadChannel

Provides ByteReadChannel for the given range of the content

Inherited Functions

getProperty

open fun <T : Any> getProperty(key: AttributeKey<T>): T?

Gets an extension property for this content

setProperty

open fun <T : Any> setProperty(key: AttributeKey<T>, value: T?): Unit

Sets an extension property for this content

Inheritors

URIFileContent

class URIFileContent : ReadChannelContent

Represents a content that is served from the specified uri