api

http4k / org.http4k.core / MemoryBody

MemoryBody

data class MemoryBody : Body

Represents a body that is backed by an in-memory ByteBuffer. Closing this has no effect.

Constructors

Name Summary
<init> MemoryBody(payload: String)
MemoryBody(payload: ByteArray)
Represents a body that is backed by an in-memory ByteBuffer. Closing this has no effect.MemoryBody(payload: ByteBuffer)

Properties

Name Summary
length Will be null for bodies where it’s impossible to a priori determine - e.g. StreamBodyval length: Long
payload val payload: ByteBuffer
stream val stream: ByteArrayInputStream

Functions

Name Summary
close fun close(): Unit
toString fun toString(): String

Extension Functions

Name Summary
gunzipped fun Body.gunzipped(): Body
gunzippedStream fun Body.gunzippedStream(): Body
gzipped fun Body.gzipped(): CompressionResult
gzippedStream fun Body.gzippedStream(): CompressionResult