Non-blocking JSON serialization for Kotlin

Kotlin classes to perform non-blocking auto-serialization.

License

License

Categories

Categories

Kotlin Languages Net JSON Data
GroupId

GroupId

net.pwall.json
ArtifactId

ArtifactId

json-kotlin-nonblocking
Last Version

Last Version

0.6
Release Date

Release Date

Type

Type

jar
Description

Description

Non-blocking JSON serialization for Kotlin
Kotlin classes to perform non-blocking auto-serialization.
Project URL

Project URL

https://github.com/pwall567/json-kotlin-nonblocking
Source Code Management

Source Code Management

https://github.com/pwall567/json-kotlin-nonblocking

Download json-kotlin-nonblocking

How to add to project

<!-- https://jarcasting.com/artifacts/net.pwall.json/json-kotlin-nonblocking/ -->
<dependency>
    <groupId>net.pwall.json</groupId>
    <artifactId>json-kotlin-nonblocking</artifactId>
    <version>0.6</version>
</dependency>
// https://jarcasting.com/artifacts/net.pwall.json/json-kotlin-nonblocking/
implementation 'net.pwall.json:json-kotlin-nonblocking:0.6'
// https://jarcasting.com/artifacts/net.pwall.json/json-kotlin-nonblocking/
implementation ("net.pwall.json:json-kotlin-nonblocking:0.6")
'net.pwall.json:json-kotlin-nonblocking:jar:0.6'
<dependency org="net.pwall.json" name="json-kotlin-nonblocking" rev="0.6">
  <artifact name="json-kotlin-nonblocking" type="jar" />
</dependency>
@Grapes(
@Grab(group='net.pwall.json', module='json-kotlin-nonblocking', version='0.6')
)
libraryDependencies += "net.pwall.json" % "json-kotlin-nonblocking" % "0.6"
[net.pwall.json/json-kotlin-nonblocking "0.6"]

Dependencies

compile (5)

Group / Artifact Type Version
net.pwall.json : jsonutil jar 5.0
net.pwall.json : json-kotlin jar 4.2
net.pwall.util : co-pipelines jar 0.6
org.jetbrains.kotlin : kotlin-stdlib-jdk8 jar 1.4.0
org.jetbrains.kotlin : kotlin-reflect jar 1.4.0

test (3)

Group / Artifact Type Version
org.jetbrains.kotlin : kotlin-test-junit jar 1.4.0
net.pwall.json : json-kotlin-test-classes jar 1.6
net.pwall.json : json-kotlin-test jar 0.10

Project Modules

There are no modules declared in this project.

json-kotlin-nonblocking

Build Status License: MIT Kotlin Maven Central

Non-blocking JSON serialization for Kotlin

This library allows a JSON object to be serialized to a non-blocking stream, for example a ByteWriteChannel. It is designed to be used in conjunction with the co-pipelines library, as follows:

fun serializeToByteChannel(obj: Any?, channel: ByteWriteChannel) {
    val pipeline = CoEncoderFactory.getEncoder(Charsets.UTF_8, ByteChannelCoAcceptor(channel))
    pipeline.outputJSON(obj)
}

In this example, the getEncoder() function will create a non-blocking pipeline that takes characters (the stringified JSON), converts them to a UTF-8 byte stream and pipes it to the channel.

This a very much a work in progress; stay tuned for more developments (and with any luck, more documentation).

Dependency Specification

The latest version of the library is 0.6, and it may be obtained from the Maven Central repository.

Maven

    <dependency>
      <groupId>net.pwall.json</groupId>
      <artifactId>json-kotlin-nonblocking</artifactId>
      <version>0.6</version>
    </dependency>

Gradle

    implementation 'net.pwall.json:json-kotlin-nonblocking:0.6'

Gradle (kts)

    implementation("net.pwall.json:json-kotlin-nonblocking:0.6")

Peter Wall

2021-04-25

Versions

Version
0.6
0.5
0.4
0.3
0.2
0.1