Skip to content

Fixed bytes

Represents a fixed-length byte array.

  • Kotlin Definition: FixedBytesDefinition
  • Kotlin Value: Bytes (maryk.core.properties.types.Bytes)
  • Maryk Yaml Definition: FixedBytes
  • Value
  • Map key or value
  • Inside List/Set
  • required - default true
  • final - default false
  • unique - default false
  • minValue - default unset. Minimum value
  • maxValue - default unset. Maximum value
  • default - the default value to be used if value was not set.
  • byteSize - fixed bytes size

Example of a Fixed Bytes property definition for use within a Model

val value by fixedBytes(
index = 1u,
byteSize = 4,
required = false,
final = true,
unique = true,
default = Bytes.ofHex("00010100"),
minValue = Bytes.ofHex("00000000"),
maxValue = Bytes.ofHex("01010000")
)

Example of a separate Kotlin Fixed Bytes property definition

val def = FixedBytesDefinition(
required = false,
final = true,
unique = true,
byteSize = 4,
default = Bytes.ofHex("00010100"),
minValue = Bytes.ofHex("00000000"),
maxValue = Bytes.ofHex("01010000")
)

The byte array of the property. In transport bytes it is encoded as Length Delimited.

Base 64 representation of the bytes