InputReader

final class InputReader[Config <: Config](parser: Parser[_], directParser: DirectJsonParser, receiverWrapper: () => Config, config: Config, val target: Target)

Stateful, mutable abstraction for reading a stream of CBOR or JSON data from the given input.

class Object
trait Matchable
class Any

Value members

Concrete methods

@inline
def apply[T : Decoder]: T
def bufferUnsizedBytes[Bytes]()(implicit byteAccess: ByteAccess[Bytes]): InputReader[Config]
def bufferUnsizedTextBytes[Bytes]()(implicit byteAccess: ByteAccess[Bytes]): InputReader[Config]

If the current data item is an unsized Text item it'll be buffered and converted into a sized text item.

If the current data item is an unsized Text item it'll be buffered and converted into a sized text item.

def charsCompare(value: Array[Char]): Int

Returns one of the following 4 values:

Returns one of the following 4 values:

  • Int.MinValue if the next data item is not a string
  • a negative value (!= Int.MinValue) a if the next data item is a string that compares as '<' to value
  • zero if the next data item is a string that compares as '==' to value
  • a positive value if the next data item is a string that compares as '>' to value

NOTE: This method causes text bytes (sized or unsized) to be buffered and converted to Chars data items!

@inline
def cursor: Long
@inline
def dataItem(): Int
@tailrec

If the current data item is a sized or unsized Text item it'll be buffered and decoded into a Chars data item.

If the current data item is a sized or unsized Text item it'll be buffered and decoded into a Chars data item.

@inline
def has(item: Int): Boolean

Checks whether the next data item is of the given type.

Checks whether the next data item is of the given type.

Example: reader.has(DataItem.Int)

@inline
def hasAnyOf(mask: Int): Boolean

Checks whether the next data item type is masked in the given bit mask.

Checks whether the next data item type is masked in the given bit mask.

Example: reader.hasAnyOf(DataItem.Int | DataItem.Float)

@inline
def hasArrayHeader: Boolean
@inline
def hasArrayHeader(length: Int): Boolean
@inline
def hasArrayHeader(length: Long): Boolean
@inline
def hasArrayStart: Boolean
@inline
def hasBoolean: Boolean
@inline
def hasBoolean(value: Boolean): Boolean
@inline
def hasBreak: Boolean
@inline
def hasByte: Boolean
@inline
def hasByte(value: Byte): Boolean
@inline
def hasByteArray: Boolean
@inline
def hasBytes: Boolean
@inline
def hasBytesStart: Boolean
@inline
def hasChar: Boolean
@inline
def hasChar(value: Char): Boolean
@inline
def hasChars: Boolean
@inline
def hasChars(value: Array[Char]): Boolean

Tests the next data item for equality with the given Array[Char]. NOTE: This method causes text bytes (sized or unsized) to be buffered and converted to Chars data items!

Tests the next data item for equality with the given Array[Char]. NOTE: This method causes text bytes (sized or unsized) to be buffered and converted to Chars data items!

@inline
def hasDouble: Boolean
@inline
def hasDouble(value: Double): Boolean
@inline
def hasEndOfInput: Boolean
@inline
def hasFloat: Boolean
@inline
def hasFloat(value: Float): Boolean
@inline
def hasFloat16: Boolean
@inline
def hasFloat16(value: Float): Boolean
@inline
def hasInt: Boolean
@inline
def hasInt(value: Int): Boolean
@inline
def hasLong: Boolean
@inline
def hasLong(value: Long): Boolean
@inline
def hasMapHeader: Boolean
@inline
def hasMapHeader(length: Int): Boolean
@inline
def hasMapHeader(length: Long): Boolean
@inline
def hasMapStart: Boolean
@inline
def hasNull: Boolean
@inline
def hasNumberString: Boolean
@inline
def hasNumberString(value: String): Boolean
@inline
def hasOverLong: Boolean
@inline
def hasOverLong(value: Long): Boolean
@inline
def hasShort: Boolean
@inline
def hasShort(value: Short): Boolean
@inline
def hasSimpleValue: Boolean
@inline
def hasSimpleValue(value: Int): Boolean
@inline
def hasSizedBytes: Boolean
@inline
def hasSizedTextBytes: Boolean
@inline
def hasString: Boolean
@inline
def hasString(value: String): Boolean

Tests the next data item for equality with the given String. NOTE: This method causes text bytes (sized or unsized) to be buffered and converted to Chars data items!

Tests the next data item for equality with the given String. NOTE: This method causes text bytes (sized or unsized) to be buffered and converted to Chars data items!

@inline
def hasTag: Boolean
@inline
def hasTag(tag: Tag): Boolean
@inline
def hasTextBytes: Boolean
@inline
def hasTextStart: Boolean
@inline
def hasUndefined: Boolean
@inline
def hasUnsizedBytes: Boolean
@inline
def hasUnsizedTextBytes: Boolean
@inline
def input: Input[_]
def longCompare(value: Long): Int

Returns one of the following 4 values:

Returns one of the following 4 values:

  • Int.MaxValue if the next data item is not a Long
  • minus one a if the next data item is a Long < value
  • zero if the next data item is a Long == value
  • one if the next data item is a Long > value
@inline
def overLongNegative: Boolean
@inline
def overflow(msg: String): Nothing
@inline
@inline
def read[T]()(implicit decoder: Decoder[T]): T
@inline
def readArrayClose[T](unbounded: Boolean, value: T): T
def readArrayHeader(): Long
@inline
def readArrayHeader(length: Int): InputReader[Config]
@inline
def readArrayHeader(length: Long): InputReader[Config]
@inline
def readArrayOpen(arity: Long): Boolean
def readBoolean(): Boolean
def readBreak(): InputReader[Config]
def readByte(): Byte
def readByteArray(): Array[Byte]
def readBytes[Bytes : ByteAccess](): Bytes
def readChar(): Char
def readChars(): Array[Char]
def readChars(chars: Array[Char]): InputReader[Config]
def readDouble(): Double
@inline
def readEndOfInput(): Unit
def readFloat(): Float
def readFloat16(): Float
def readInt(): Int
def readLong(): Long
@inline
def readMapClose[T](unbounded: Boolean, value: T): T
def readMapHeader(): Long
@inline
def readMapHeader(length: Int): InputReader[Config]
@inline
def readMapHeader(length: Long): InputReader[Config]
@inline
def readMapOpen(arity: Long): Boolean
def readMapStart(): InputReader[Config]
def readNull(): Null
def readNumberString(): String
def readOverLong(): Long
def readShort(): Short
def readSimpleValue(): Int
@inline
def readSimpleValue(value: Int): InputReader[Config]
def readSizedBytes[Bytes]()(implicit byteAccess: ByteAccess[Bytes]): Bytes
def readSizedTextBytes[Bytes]()(implicit byteAccess: ByteAccess[Bytes]): Bytes
def readString(): String
def readString(s: String): InputReader[Config]
def readTag(): Tag
@inline
def readTag(tag: Tag): InputReader[Config]
def readTextBytes[Bytes : ByteAccess](): Bytes
def readTextStart(): InputReader[Config]
def readUndefined(): InputReader[Config]
def readUnsizedBytes[Bytes]()(implicit byteAccess: ByteAccess[Bytes]): Bytes
def readUnsizedTextBytes[Bytes]()(implicit byteAccess: ByteAccess[Bytes]): Bytes
def readUntilBreak[M[_], T : Decoder]()(implicit evidence$4: Decoder[T], factory: Factory[T, M[T]]): M[T]
def readUntilBreak[T](zero: T)(f: T => T): T
@inline
def readingCbor: Boolean
@inline
def readingJson: Boolean
def skipDataItem(): InputReader[Config]

Skips the current (atomic) data item.

Skips the current (atomic) data item.

CAUTION: If the data item is an Array/Map - Start/Header then this call will NOT skip the whole array or map, but only the starting data item! Use skipElement instead if you also want to skip complex elements!

def skipElement(): InputReader[Config]

Moves the cursor beyond the current data element, thereby also skipping complex, potentially nested array or map structures.

Moves the cursor beyond the current data element, thereby also skipping complex, potentially nested array or map structures.

@inline
def stringCompare(value: String): Int

Returns one of the following 4 values:

Returns one of the following 4 values:

  • Int.MinValue if the next data item is not a string
  • a negative value (!= Int.MinValue) a if the next data item is a string that compares as '<' to value
  • zero if the next data item is a string that compares as '==' to value
  • a positive value if the next data item is a string that compares as '>' to value

NOTE: This method causes text bytes (sized or unsized) to be buffered and converted to Chars data items!

@inline
def tryReadArrayHeader(length: Int): Boolean
@inline
def tryReadArrayHeader(length: Long): Boolean
@inline
def tryReadArrayStart(): Boolean
@inline
def tryReadBoolean(value: Boolean): Boolean
@inline
def tryReadBreak(): Boolean
@inline
def tryReadByte(value: Byte): Boolean
@inline
def tryReadBytesStart(): Boolean
@inline
def tryReadChar(value: Char): Boolean
@inline
def tryReadChars(value: Array[Char]): Boolean

Tests the next data item for equality with the given Array[Char] and advances the cursor if so. NOTE: This method causes text bytes (sized or unsized) to be buffered and converted to Chars data items!

Tests the next data item for equality with the given Array[Char] and advances the cursor if so. NOTE: This method causes text bytes (sized or unsized) to be buffered and converted to Chars data items!

def tryReadCharsCompare(value: Array[Char]): Int

Returns one of the following 4 values:

Returns one of the following 4 values:

  • Int.MinValue if the next data item is not a string
  • a negative value (!= Int.MinValue) a if the next data item is a string that compares as '<' to value
  • zero if the next data item is a string that compares as '==' to value
  • a positive value if the next data item is a string that compares as '>' to value

Advanced the cursor if the return value is zero.

NOTE: This method causes text bytes (sized or unsized) to be buffered and converted to Chars data items!

@inline
def tryReadDouble(value: Double): Boolean
@inline
def tryReadEndOfInput(): Boolean
@inline
def tryReadFloat(value: Float): Boolean
@inline
def tryReadFloat16(value: Float): Boolean
@inline
def tryReadInt(value: Int): Boolean
@inline
def tryReadLong(value: Long): Boolean
def tryReadLongCompare(value: Long): Int
@inline
def tryReadMapHeader(length: Int): Boolean
@inline
def tryReadMapHeader(length: Long): Boolean
@inline
def tryReadMapStart(): Boolean
@inline
def tryReadNull(): Boolean
@inline
def tryReadNumberString(value: String): Boolean
@inline
def tryReadOverLong(value: Long): Boolean
@inline
def tryReadShort(value: Short): Boolean
@inline
def tryReadSimpleValue(value: Int): Boolean
@inline
def tryReadString(value: String): Boolean

Tests the next data item for equality with the given String and advances the cursor if so. NOTE: This method causes text bytes (sized or unsized) to be buffered and converted to Chars data items!

Tests the next data item for equality with the given String and advances the cursor if so. NOTE: This method causes text bytes (sized or unsized) to be buffered and converted to Chars data items!

def tryReadStringCompare(value: String): Int

Returns one of the following 4 values:

Returns one of the following 4 values:

  • Int.MinValue if the next data item is not a string
  • a negative value (!= Int.MinValue) a if the next data item is a string that compares as '<' to value
  • zero if the next data item is a string that compares as '==' to value
  • a positive value if the next data item is a string that compares as '>' to value

Advanced the cursor if the return value is zero.

NOTE: This method causes text bytes (sized or unsized) to be buffered and converted to Chars data items!

@inline
def tryReadTag(tag: Tag): Boolean
@inline
def tryReadTextStart(): Boolean
@inline
def tryReadUndefined(): Boolean
def unexpectedDataItem(expected: String): Nothing
@inline
def unexpectedDataItem(expected: String, actual: String): Nothing
@inline
def validationFailure(msg: String): Nothing

Concrete fields