WriterConfig

zio.blocks.schema.json.WriterConfig
See theWriterConfig companion object
class WriterConfig extends Serializable

Configuration for zio.blocks.schema.json.JsonWriter that contains params for formatting of output JSON and for tuning of preferred size for internal byte buffer that is created on the writer instantiation and reused in runtime for serialization of messages using any type of output except heap byte buffers supplied as arguments. All configuration params already initialized to default values, but in some cases they should be altered:

  • turn on pretty printing by specifying of an indention step that is greater than 0
  • turn on escaping of Unicode characters to serialize with only ASCII characters
  • increase the preferred size of an internal byte buffer to reduce the allocation rate of grown and then reduced internal buffers when the serialized output size is greater than 32Kb

Value parameters

escapeUnicode

a flag to turn on hexadecimal escaping of all non-ASCII chars

indentionStep

a size of indention for pretty-printed formatting or 0 for compact output

preferredBufSize

a preferred size (in bytes) of an internal byte buffer when writing to any type of output except pre-allocated byte arrays or heap byte buffers supplied as arguments

Attributes

Companion
object
Source
WriterConfig.scala
Graph
Supertypes
trait Serializable
class Object
trait Matchable
class Any
Known subtypes
object WriterConfig

Members list

Value members

Concrete methods

def withEscapeUnicode(escapeUnicode: Boolean): WriterConfig

Attributes

Source
WriterConfig.scala
def withIndentionStep(indentionStep: Int): WriterConfig

Attributes

Source
WriterConfig.scala
def withPreferredBufSize(preferredBufSize: Int): WriterConfig

Attributes

Source
WriterConfig.scala

Concrete fields

val escapeUnicode: Boolean

Attributes

Source
WriterConfig.scala
val indentionStep: Int

Attributes

Source
WriterConfig.scala
val preferredBufSize: Int

Attributes

Source
WriterConfig.scala