zio.json.internal

Members list

Type members

Classlikes

case object ByteNone extends ByteOption

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class ByteOption
class Object
trait Matchable
class Any
Show all
Self type
ByteNone.type
sealed abstract class ByteOption

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object ByteNone
class ByteSome
case class ByteSome(value: Byte) extends ByteOption

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class ByteOption
class Object
trait Matchable
class Any
Show all
case object DoubleNone extends DoubleOption

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class DoubleOption
class Object
trait Matchable
class Any
Show all
Self type
DoubleNone.type
sealed abstract class DoubleOption

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object DoubleNone
class DoubleSome
case class DoubleSome(value: Double) extends DoubleOption

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class DoubleOption
class Object
trait Matchable
class Any
Show all
final class FastCharSequence(s: Array[Char]) extends CharSequence

Attributes

Supertypes
trait CharSequence
class Object
trait Matchable
class Any
final class FastStringWrite(initial: Int) extends Write

Attributes

Supertypes
trait Write
class Object
trait Matchable
class Any
case object FloatNone extends FloatOption

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class FloatOption
class Object
trait Matchable
class Any
Show all
Self type
FloatNone.type
sealed abstract class FloatOption

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object FloatNone
class FloatSome
case class FloatSome(value: Float) extends FloatOption

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class FloatOption
class Object
trait Matchable
class Any
Show all
case object IntNone extends IntOption

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class IntOption
class Object
trait Matchable
class Any
Show all
Self type
IntNone.type
sealed abstract class IntOption

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object IntNone
class IntSome
case class IntSome(value: Int) extends IntOption

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class IntOption
class Object
trait Matchable
class Any
Show all
object Lexer

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
Lexer.type
case object LongNone extends LongOption

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class LongOption
class Object
trait Matchable
class Any
Show all
Self type
LongNone.type
sealed abstract class LongOption

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object LongNone
class LongSome
case class LongSome(value: Long) extends LongOption

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class LongOption
class Object
trait Matchable
class Any
Show all
sealed trait RetractReader

A Reader that can retract and replay the last char that it read.

A Reader that can retract and replay the last char that it read.

This is essential when parsing contents that do not have a terminator character, e.g. numbers, whilst preserving the non-significant character for further processing.

Attributes

Supertypes
class Reader
trait Closeable
trait Readable
class Object
trait Matchable
class Any
Show all
Known subtypes
object SafeNumbers

Total, fast, number parsing.

Total, fast, number parsing.

The Java and Scala standard libraries throw exceptions when we attempt to parse an invalid number. Unfortunately, exceptions are very expensive, and untrusted data can be maliciously constructed to DOS a server.

This suite of functions mitigates against such attacks by building up the numbers one character at a time, which has been shown through extensive benchmarking to be orders of magnitude faster than exception-throwing stdlib parsers, for valid and invalid inputs. This approach, proposed by alexknvl, was also benchmarked against regexp-based pre-validation.

Note that although the behaviour is identical to the Java stdlib when given the canonical form of a primitive (i.e. the .toString) of a number there may be differences in behaviour for non-canonical forms. e.g. the Java stdlib may reject "1.0" when parsed as an BigInteger but we may parse it as a 1, although "1.1" would be rejected. Parsing of BigDecimal preserves the trailing zeros on the right but not on the left, e.g. "000.00001000" will be "1.000e-5", which is useful in cases where the trailing zeros denote measurement accuracy.

BigInteger, BigDecimal, Float and Double have a configurable bit limit on the size of the significand, to avoid OOM style attacks, which is 128 bits by default.

Results are contained in a specialisation of Option that avoids boxing.

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type
case object ShortNone extends ShortOption

Attributes

Supertypes
trait Singleton
trait Product
trait Mirror
trait Serializable
trait Product
trait Equals
class ShortOption
class Object
trait Matchable
class Any
Show all
Self type
ShortNone.type
sealed abstract class ShortOption

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
object ShortNone
class ShortSome
case class ShortSome(value: Short) extends ShortOption

Attributes

Supertypes
trait Serializable
trait Product
trait Equals
class ShortOption
class Object
trait Matchable
class Any
Show all
final class StringMatrix(val xs: Array[String], aliases: Array[(String, Int)])

Attributes

Supertypes
class Object
trait Matchable
class Any
object UnsafeNumbers

Attributes

Supertypes
class Object
trait Matchable
class Any
Self type

Attributes

Supertypes
class Reader
trait Closeable
trait Readable
class Object
trait Matchable
class Any
Show all
trait Write

Attributes

Supertypes
class Object
trait Matchable
class Any
Known subtypes
final class WriteWriter(out: Writer) extends Write

Attributes

Supertypes
trait Write
class Object
trait Matchable
class Any