Package aws.smithy.kotlin.runtime.content

Types

Link copied to clipboard
expect class BigDecimal(value: String) : Number
actual typealias BigDecimal = BigDecimal
Link copied to clipboard
expect class BigInteger(value: String) : Number
actual typealias BigInteger = BigInteger
Link copied to clipboard
class ByteArrayContent(bytes: ByteArray) : ByteStream.Buffer

Container for wrapping a ByteArray as a ByteStream

Link copied to clipboard
sealed class ByteStream

Represents an abstract read-only stream of bytes

Link copied to clipboard
sealed class Document

A Document is used to store arbitrary or unstructured data.

Link copied to clipboard
class DocumentBuilder
Link copied to clipboard
class FileContent(    val file: File,     val start: Long = 0,     val endInclusive: Long = file.length() - 1) : ByteStream.SourceStream

ByteStream backed by a local file

Link copied to clipboard
class StringContent(str: String) : ByteStream.Buffer

Container for wrapping a String as a ByteStream

Functions

Link copied to clipboard
fun File.asByteStream(range: LongRange): ByteStream

Create a ByteStream from a file with the given range

fun Path.asByteStream(range: LongRange): ByteStream

Create a ByteStream from a path with the given range

fun File.asByteStream(start: Long = 0, endInclusive: Long = length() - 1): ByteStream

Create a ByteStream from a file

fun Path.asByteStream(start: Long = 0, endInclusive: Long = -1): ByteStream

Create a ByteStream from a path

Link copied to clipboard
fun buildDocument(init: DocumentBuilder.() -> Unit): Document

Builds a Document with the given builder.

Link copied to clipboard
fun ByteStream.cancel()
Link copied to clipboard
suspend fun ByteStream.decodeToString(): String
Link copied to clipboard
fun Document(value: Boolean): Document

Construct a Document from a Boolean.

fun Document(value: Number): Document

Construct a Document from a Number of arbitrary precision.

fun Document(value: String): Document

Construct a Document from a String.

fun Document(value: List<Document?>): Document

Construct a Document from a List.

fun Document(value: Map<String, Document?>): Document

Construct a Document from a Map.

Link copied to clipboard
fun ByteStream.Companion.fromFile(file: File): ByteStream

Create a ByteStream from a file

Link copied to clipboard
suspend fun ByteStream.toByteArray(): ByteArray

Consume the ByteStream and pull the entire contents into memory as a ByteArray. Only do this if you are sure the contents fit in-memory as this will read the entire contents of a streaming variant.

Link copied to clipboard
suspend fun ByteStream.writeToFile(file: File): Long

Write the contents of this ByteStream to file and close it

suspend fun ByteStream.writeToFile(path: Path): Long

Write the contents of this ByteStream to file at the given path