You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Before diving into the FlatBuffers usage in Kotlin, it should be noted that
7
+
the [Tutorial](../tutorial.md) page has a complete guide to
8
+
general FlatBuffers usage in all of the supported languages (including K).
9
+
10
+
This page is designed to cover the nuances of FlatBuffers usage, specific to Kotlin.
11
+
12
+
You should also have read the [Building](../building.md)
13
+
documentation to build `flatc` and should be familiar with
14
+
[Using the schema compiler](../flatc.md) and
15
+
[Writing a schema](../schema.md).
16
+
17
+
## Kotlin and FlatBuffers Java code location
18
+
19
+
Code generated for Kotlin currently uses the flatbuffers java runtime library. That means that Kotlin generated code can only have Java virtual machine as target architecture (which includes Android). Kotlin Native and Kotlin.js are currently not supported.
20
+
21
+
The code for the FlatBuffers Java library can be found at
22
+
`flatbuffers/java/com/google/flatbuffers`. You can browse the library on the
Kotlin generated code was designed to be as close as possible to the java counterpart, as for now, we only support kotlin on java virtual machine. So the differences in implementation and usage are basically the ones introduced by the Kotlin language itself. You can find more in-depth information [here](https://kotlinlang.org/docs/reference/comparison-to-java.html).
80
+
81
+
The most obvious ones are:
82
+
83
+
* Fields as accessed as Kotlin [properties](https://kotlinlang.org/docs/reference/properties.html)
84
+
* Static methods are accessed in [companion object](https://kotlinlang.org/docs/reference/classes.html#companion-objects)
0 commit comments