All Downloads are FREE. Search and download functionalities are using the official Maven repository.

commonMain.io.ktor.http.content.ByteArrayContent.kt Maven / Gradle / Ivy

package io.ktor.http.content

import io.ktor.http.*

/**
 * Implementation of the [OutgoingContent.ByteArrayContent] for sending array of bytes
 */
class ByteArrayContent(
    private val bytes: ByteArray,
    override val contentType: ContentType? = null,
    override val status: HttpStatusCode? = null
) : OutgoingContent.ByteArrayContent() {
    override val contentLength: Long get() = bytes.size.toLong()

    override fun bytes(): ByteArray = bytes
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy