Package

com.github.plokhotnyuk.jsoniter_scala

core

Permalink

package core

Visibility
  1. Public
  2. All

Type Members

  1. abstract class JsonCodec[A] extends AnyRef

    Permalink
  2. class JsonParseException extends RuntimeException

    Permalink
  3. final class JsonReader extends AnyRef

    Permalink
  4. final class JsonWriter extends AnyRef

    Permalink
  5. case class ReaderConfig(throwParseExceptionWithStackTrace: Boolean = true, appendHexDumpToParseException: Boolean = true, preferredBufSize: Int = 16384, preferredCharBufSize: Int = 2048) extends Product with Serializable

    Permalink

    Configuration for com.github.plokhotnyuk.jsoniter_scala.core.JsonReader that contains flags for tuning of parsing exceptions and preferred sizes for internal buffers that created on the reader instantiation and reused in runtime for parsing of messages.

    Configuration for com.github.plokhotnyuk.jsoniter_scala.core.JsonReader that contains flags for tuning of parsing exceptions and preferred sizes for internal buffers that 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:

    • turn off stack traces for parsing exceptions to greatly reduce impact on performance for cases when exceptions can be not exceptional, see more details here: https://shipilev.net/blog/2014/exceptional-performance/
    • turn off appending of hex dump to minimize length of exception message
    • increase preferred size of an internal char buffer to reduce allocation rate of grown and then reduced buffers when lot of large strings with length greater than 2K need to be parsed
    • increase preferred size of an internal byte buffer for parsing from java.io.InputStream to reduce allocation rate of grown and then reduced buffers when during parsing of large ADT instances (>16Kb) the discriminator field does not appear in the beginning of the JSON object
    throwParseExceptionWithStackTrace

    a flag that allows to turn off a stack trace for parsing exceptions

    appendHexDumpToParseException

    a flag that allows to turn off hex dumping of affected by error part of an internal byte buffer

    preferredBufSize

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

    preferredCharBufSize

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

  6. case class WriterConfig(indentionStep: Int = 0, escapeUnicode: Boolean = false, preferredBufSize: Int = 16384) extends Product with Serializable

    Permalink

    Configuration for com.github.plokhotnyuk.jsoniter_scala.core.JsonWriter that contains params for formatting of output JSON and for tuning of preferred size for internal byte buffer that created on the writer instantiation and reused in runtime for serialization of messages using java.io.OutputStream.

    Configuration for com.github.plokhotnyuk.jsoniter_scala.core.JsonWriter that contains params for formatting of output JSON and for tuning of preferred size for internal byte buffer that created on the writer instantiation and reused in runtime for serialization of messages using java.io.OutputStream.
    All configuration params already initialized to default values, but in some cases they should be altered:

    • turn on pretty printing by specifying of indention step that is greater than 0
    • turn on escaping of Unicode characters to serialize with only ASCII characters
    • increase preferred size of an internal byte buffer to reduce allocation rate of grown and then reduced buffers when writing to java.io.OutputStream lot of large (>16Kb) scala.math.BigDecimal, scala.math.BigInt or others non escaped ASCII strings written using JsonWriter.writeNonEscapedAsciiKey or JsonWriter.writeNonEscapedAsciiVal
    indentionStep

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

    escapeUnicode

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

    preferredBufSize

    a preferred size (in bytes) of an internal byte buffer when writing to java.io.OutputStream

Value Members

  1. object JsonReader

    Permalink
  2. object JsonWriter

    Permalink
  3. object UnsafeUtils

    Permalink

Ungrouped