ReaderConfig

zio.blocks.schema.json.ReaderConfig
See theReaderConfig companion object
class ReaderConfig extends Serializable

Configuration for zio.blocks.schema.json.JsonReader that contains flags for tuning of preferred sizes for internal buffers that are created on the reader instantiation and reused in runtime for parsing of messages. All configuration params already initialized by recommended default values, but in some cases they should be altered for performance reasons:

  • increase preferred size of an internal byte buffer for parsing from java.io.InputStream or java.nio.ByteBuffer to reduce allocation rate of grown and then reduced buffers during parsing of large (>32Kb) numbers (including stringified), raw values, or ADT instances with the discriminator field doesn't appear at the beginning of the JSON object
  • increase the preferred size of an internal char buffer to reduce the allocation rate of grown and then reduced buffers when large (>4Kb) string instances

Value parameters

checkForEndOfInput

a flag to check and raise an error if some non-whitespace bytes are detected after successful parsing of the value

maxBufSize

a max size (in bytes) of an internal byte buffer when parsing from java.io.InputStream or java.nio.ByteBuffer

maxCharBufSize

a max size (in chars) of an internal char buffer for parsing of string values

preferredBufSize

a preferred size (in bytes) of an internal byte buffer when parsing from java.io.InputStream or java.nio.ByteBuffer

preferredCharBufSize

a preferred size (in chars) of an internal char buffer for parsing of string values

Attributes

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

Members list

Value members

Concrete methods

def withCheckForEndOfInput(checkForEndOfInput: Boolean): ReaderConfig

Attributes

Source
ReaderConfig.scala
def withMaxBufSize(maxBufSize: Int): ReaderConfig

Attributes

Source
ReaderConfig.scala
def withMaxCharBufSize(maxCharBufSize: Int): ReaderConfig

Attributes

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

Attributes

Source
ReaderConfig.scala
def withPreferredCharBufSize(preferredCharBufSize: Int): ReaderConfig

Attributes

Source
ReaderConfig.scala

Concrete fields

val checkForEndOfInput: Boolean

Attributes

Source
ReaderConfig.scala
val maxBufSize: Int

Attributes

Source
ReaderConfig.scala
val maxCharBufSize: Int

Attributes

Source
ReaderConfig.scala
val preferredBufSize: Int

Attributes

Source
ReaderConfig.scala

Attributes

Source
ReaderConfig.scala