🌐
Kotlin
kotlinlang.org › api › kotlinx.serialization › kotlinx-serialization-protobuf › kotlinx.serialization.protobuf › -proto-buf
ProtoBuf | kotlinx.serialization – Kotlin Programming Language
It is typically used by constructing an application-specific instance, with configured specific behavior and, if necessary, registered custom serializers (in SerializersModule provided by serializersModule constructor parameter). Default encoding is proto2, although proto3 can be used with a number of tweaks (see the section below for details). Given a ProtoBuf definition with one required field, one optional field, and one optional field with a custom default value:
🌐
Kotlin
kotlinlang.org › api › kotlinx.serialization › kotlinx-serialization-protobuf › kotlinx.serialization.protobuf
kotlinx.serialization.protobuf | kotlinx.serialization – Kotlin Programming Language
TypesFunctions · Proto · Buf · Link copied to clipboard · @ExperimentalSerializationApisealed class ProtoBuf : BinaryFormat · Implements encoding and decoding classes to/from bytes using Protocol buffers specification.
Discussions

Protobuf serialization in kotlin

Are you intending to align with kotlinx.serialization? In the general case, I would advise doing so - this is the emerging standard for Kotlin serialization which spans serialization formats (JSON, CBOR, and Protobuf first supported) and is designed to work with multi-platform.

More on reddit.com
🌐 r/Kotlin
12
6
April 8, 2019
kotlin - How to serialize a library class to Protobuf with kotlinx.serialization? - Stack Overflow
How to serialize a library class to Protobuf with kotlinx.serialization? Since it's non-editable, I can't add @SerialId annotations to its properties as instructed in runtime_usage.md#protobuf. If I More on stackoverflow.com
🌐 stackoverflow.com
kotlin - How to parse protobuf message in kotlinx serialization - Stack Overflow
I have a protobuf message Request and Response. What is the correct representation of this for Kotlin data class for kolinx.serialization. Protobuf serialization is still experimental docs. Can I ... More on stackoverflow.com
🌐 stackoverflow.com
Why should I use kotlinx.serialization?
One of the reasons why kotlinx.serialization doesn't serialize anything you throw at it (like how Gson works) is because kotlinx.serialization doesn't rely on Reflection to find out what fields should be serialized, the serializer/deserializer is generated during compilation, which is why it requires a compiler plugin. This also means that you end up needing to create your own serializer/deserializers for any class that isn't @Serializable. More on reddit.com
🌐 r/Kotlin
29
37
February 24, 2023
🌐
Protocol Buffers
protobuf.dev › getting-started › kotlintutorial
Protocol Buffer Basics: Kotlin | Protocol Buffers Documentation
The definitions in a .proto file are simple: you add a message for each data structure you want to serialize, then specify a name and a type for each field in the message. In our example, the .proto file that defines the messages is addressbook.proto. The .proto file starts with a package ...
🌐
Maven Repository
mvnrepository.com › artifact › org.jetbrains.kotlinx › kotlinx-serialization-protobuf
Maven Repository: org.jetbrains.kotlinx » kotlinx-serialization-protobuf
January 21, 2026 - Home » org.jetbrains.kotlinx » kotlinx-serialization-protobuf · Kotlin multiplatform serialization runtime library · LicenseApache 2.0 · Tagsprotobufserializationkotlinprotocoljetbrains · Ranking · #3677in MvnRepository · HomePage https://github.com/Kotlin/kotlinx.serialization 🔍 ...
🌐
GitHub
github.com › Kotlin › kotlinx.serialization › blob › master › docs › formats.md
kotlinx.serialization/docs/formats.md at master · Kotlin/kotlinx.serialization
Field #1: 0A String Length = 21, ... = "Kotlin" By default, field numbers in the Kotlin Serialization ProtoBuf implementation are automatically assigned, which does not provide the ability to define a stable ......
Author   Kotlin
🌐
Reddit
reddit.com › r/kotlin › protobuf serialization in kotlin
r/Kotlin on Reddit: Protobuf serialization in kotlin
April 8, 2019 -

Hello, want to use protobuf to serialize a large string object to be stored in realm, as of now using JSON which is causing huge object memory. But not sure how can I use protobuf to achieve this as there are very little online examples that isn't relevant to my usecase. protobuf uses schema (.proto) file and serialize this file so that we can use it but in my case I will get string from response that needs serialization, any help would be much appreciated.

🌐
JetBrains
blog.jetbrains.com › kotlin › 2021 › 05 › kotlinx-serialization-1-2-released
kotlinx.serialization 1.2 Released: High-Speed JSON Handling, Value Class Support, Overhauled Docs, and more | The Kotlin Blog
May 19, 2021 - Explore the new kotlinx.serialization API documentation! Protocol Buffers (Protobuf) is a binary serialization format for structured data created by Google.
Find elsewhere
🌐
Sandwwraith
sandwwraith.github.io › kotlinx.serialization › kotlinx-serialization › kotlinx.serialization.protobuf › -proto-buf › index.html
kotlinx.serialization.protobuf.ProtoBuf - kotlinx-serialization
(common, js, jvm, native) class ProtoBuf : BinaryFormat · Implements encoding and decoding classes to/from bytes using Proto2 specification. It is typically used by constructing an application-specific instance, with configured specific behaviour and, if necessary, registered custom serializers ...
🌐
Stack Overflow
stackoverflow.com › questions › 59929313 › how-to-serialize-a-library-class-to-protobuf-with-kotlinx-serialization
kotlin - How to serialize a library class to Protobuf with kotlinx.serialization? - Stack Overflow
How to serialize a library class to Protobuf with kotlinx.serialization? Since it's non-editable, I can't add @SerialId annotations to its properties as instructed in runtime_usage.md#protobuf. If I
🌐
Kotlin
kotlinlang.org › api › kotlinx.serialization › kotlinx-serialization-protobuf › kotlinx.serialization.protobuf › -proto-buf-builder
ProtoBufBuilder | kotlinx.serialization – Kotlin Programming Language
Builder of the ProtoBuf instance provided by ProtoBuf factory function. ... Specifies whether default values of Kotlin properties should be encoded. ... Module with contextual and polymorphic serializers to be used in the resulting ProtoBuf instance.
🌐
Maven Central
central.sonatype.com › artifact › org.jetbrains.kotlinx › kotlinx-serialization-protobuf
org.jetbrains.kotlinx:kotlinx-serialization-protobuf - Maven Central
--> <!-- do_not_remove: published-with-gradle-metadata --> <modelVersion>4.0.0</modelVersion> <groupId>org.jetbrains.kotlinx</groupId> <artifactId>kotlinx-serialization-protobuf</artifactId> <version>1.9.0</version> <name>kotlinx-serialization-protobuf</name> <description>Kotlin multiplatform serialization runtime library</description> <url>https://github.com/Kotlin/kotlinx.serialization</url> <licenses> <license> <name>Apache-2.0</name> <url>https://www.apache.org/licenses/LICENSE-2.0.txt</url> <distribution>repo</distribution> </license> </licenses> <developers> <developer> <id>JetBrains</id
🌐
GitHub
github.com › Kotlin › kotlinx.serialization
GitHub - Kotlin/kotlinx.serialization: Kotlin multiplatform / multi-format serialization · GitHub
Supports Kotlin classes marked as @Serializable and standard collections. Provides JSON, Protobuf, CBOR, Hocon and Properties formats. Complete multiplatform support: JVM, JS and Native.
Starred by 5.9K users
Forked by 676 users
Languages   Kotlin 99.9% | Java 0.1%
🌐
Kotlin
kotlinlang.org › api › kotlinx.serialization › kotlinx-serialization-protobuf › kotlinx.serialization.protobuf › -proto-type
ProtoType | kotlinx.serialization – Kotlin Programming Language
kotlinx-serialization-protobuf...tionApiannotation class ProtoType(val type: ProtoIntegerType)(source) Instructs to use a particular ProtoIntegerType for ......
🌐
NuGet
nuget.org › packages › Xamarin.KotlinX.Serialization.Protobuf
NuGet Gallery | Xamarin.KotlinX.Serialization.Protobuf 1.9.0.1
.NET for Android and MAUI bindings for the Android Java library 'org.jetbrains.kotlinx:kotlinx-serialization-protobuf'. Library description: Kotlin multiplatform serialization runtime library
🌐
Kotlin
kotlin.github.io › kotlinx.serialization › kotlinx-serialization-protobuf › kotlinx.serialization.protobuf › -proto-buf.html
Github
Concise Binary Object Representation (CBOR) format implementation, as per RFC 7049 · Core serialization API and serializers for standard library classes, and ready to use JSON format implementation
🌐
GitHub
github.com › Dogacel › kotlinx-protobuf-gen
GitHub - Dogacel/kotlinx-protobuf-gen: Generate kotlinx serializable data classes from protobuf · GitHub
Generate kotlin data classes from protobuf files that supports Kotlin Native that can be serialized and deserialized to protobuf using kotlinx.serialization.
Starred by 37 users
Forked by 4 users
Languages   Kotlin
🌐
Stack Overflow
stackoverflow.com › questions › 67167519 › how-to-parse-protobuf-message-in-kotlinx-serialization
kotlin - How to parse protobuf message in kotlinx serialization - Stack Overflow
I have a protobuf message Request and Response. What is the correct representation of this for Kotlin data class for kolinx.serialization. Protobuf serialization is still experimental docs. Can I ...
🌐
Kotlin
kotlinlang.org › docs › serialization.html
Serialization | Kotlin Documentation
June 16, 2026 - These formats are language-neutral and platform-neutral, so you can use them to exchange data between systems written in any modern language. Kotlin provides this functionality through the kotlinx.seri...