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

JarFileContent

class JarFileContent : ReadChannelContent

Represents an OutgoingContent for a resource inside a Jar file

LocalFileContent

class LocalFileContent : ReadChannelContent

OutgoingContent representing a local file with a specified contentType, expires date and caching

URIFileContent

class URIFileContent : ReadChannelContent

Represents a content that is served from the specified uri