summaryrefslogtreecommitdiff
path: root/formats/json/jsMain/src/kotlinx/serialization/json/internal/JsonStringBuilder.kt
blob: 1b79e27ef82a303709680ce6f53b97c9ce956ad6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
package kotlinx.serialization.json.internal

internal actual class JsonStringBuilder actual constructor() {
    private val sb = StringBuilder(128)

    actual fun append(value: Long) {
        sb.append(value)
    }

    actual fun append(ch: Char) {
        sb.append(ch)
    }

    actual fun append(string: String) {
        sb.append(string)
    }

    actual fun appendQuoted(string: String) {
        sb.printQuoted(string)
    }

    actual override fun toString(): String {
        return sb.toString()
    }

    actual fun release() {
    }
}