Serializer for ConfigMemorySize. All possible Hocon size formats [] are accepted for decoding. During encoding, the serializer emits values using powers of two: byte, KiB, MiB, GiB, TiB, PiB, EiB, ZiB, YiB. Encoding uses the largest possible integer value. Example: 1024 byte -> 1 KiB; 1024 KiB -> 1 MiB; 1025 KiB -> 1025 KiB. Usage example:

data class ConfigMemory(
val size: ConfigMemorySize
val config = ConfigFactory.parseString("size = 1 MiB")
val configMemory = Hocon.decodeFromConfig(ConfigMemory.serializer(), config)
val newConfig = Hocon.encodeToConfig(ConfigMemory.serializer(), configMemory)


Link copied to clipboard
open override val descriptor: SerialDescriptor


Link copied to clipboard
open override fun deserialize(decoder: Decoder): ConfigMemorySize
Link copied to clipboard
open override fun serialize(encoder: Encoder, value: ConfigMemorySize)