trait Input[Bytes] extends AnyRef
Mutable abstraction wrapping some source of bytes to serve as parser input.
- Alphabetic
- By Inheritance
- Input
- AnyRef
- Any
- Hide All
- Show All
- Public
- Protected
Abstract Value Members
- abstract def cursor: Long
The index of the next byte to be read.
- abstract def readByte(): Byte
Returns the next byte, if possible without any range checks.
Returns the next byte, if possible without any range checks. Advances the cursor by 1.
- abstract def readBytePadded(pp: PaddingProvider[Bytes]): Byte
Returns the next byte if not out-of-range, otherwise the one returned by the given Input.PaddingProvider.
- abstract def readBytes(length: Long, pp: PaddingProvider[Bytes]): Bytes
Returns the next
length
bytes as Bytes if the input still has this many bytes available.Returns the next
length
bytes as Bytes if the input still has this many bytes available. Otherwise the given Input.PaddingProvider is called to perform the padding and its result returned. - abstract def readDoubleByteBigEndian(): Char
Returns the next two bytes as an unsigned 16-bit value, with the first becoming the more-significant byte (i.e.
Returns the next two bytes as an unsigned 16-bit value, with the first becoming the more-significant byte (i.e. big endian/network byte order), if possible without any range checks. Advances the cursor by 2.
- abstract def readDoubleByteBigEndianPadded(pp: PaddingProvider[Bytes]): Char
Returns the next two bytes as an unsigned 16-bit value, with the first becoming the more-significant byte (i.e.
Returns the next two bytes as an unsigned 16-bit value, with the first becoming the more-significant byte (i.e. big endian/network byte order). If the input has less than 2 bytes left the given Input.PaddingProvider is called to perform the padding and its result returned.
- abstract def readOctaByteBigEndian(): Long
Returns the eight eight bytes as a Long, with the first becoming the most-significant byte (i.e.
Returns the eight eight bytes as a Long, with the first becoming the most-significant byte (i.e. big endian/network byte order), if possible without any range checks. Advances the cursor by 8.
- abstract def readOctaByteBigEndianPadded(pp: PaddingProvider[Bytes]): Long
Returns the next eight bytes as a Long, with the first becoming the most-significant byte (i.e.
Returns the next eight bytes as a Long, with the first becoming the most-significant byte (i.e. big endian/network byte order). If the input has less than 8 bytes left the given Input.PaddingProvider is called to perform the padding and its result returned.
- abstract def readQuadByteBigEndian(): Int
Returns the next four bytes as an Int, with the first becoming the most-significant byte (i.e.
Returns the next four bytes as an Int, with the first becoming the most-significant byte (i.e. big endian/network byte order), if possible without any range checks. Advances the cursor by 4.
- abstract def readQuadByteBigEndianPadded(pp: PaddingProvider[Bytes]): Int
Returns the next four bytes as an Int, with the first becoming the most-significant byte (i.e.
Returns the next four bytes as an Int, with the first becoming the most-significant byte (i.e. big endian/network byte order). If the input has less than 4 bytes left the given Input.PaddingProvider is called to perform the padding and its result returned.
- abstract def unread(numberOfBytes: Int): Input.this.type
"Unreads" the given number of bytes, which is guaranteed to be in the range [1, 255].
"Unreads" the given number of bytes, which is guaranteed to be in the range [1, 255]. This is the same as moving the cursor the given number of positions back.
NOTE: This method will never be used to move the cursor beyond the beginning of the input. As such, no range check is required by the implementation. Also the maximum number of bytes that is unread, _in total_, will never exceed 255. So any input will never have to cache more that the last 255 bytes from the head of the input.
Also: Decoding CBOR never needs unreading, so if your use case doesn't have to support JSON then it's file to simply "implement" this method with
???
.
Concrete Value Members
- final def !=(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def ##: Int
- Definition Classes
- AnyRef → Any
- final def ==(arg0: Any): Boolean
- Definition Classes
- AnyRef → Any
- final def asInstanceOf[T0]: T0
- Definition Classes
- Any
- def clone(): AnyRef
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.CloneNotSupportedException]) @native() @HotSpotIntrinsicCandidate()
- final def eq(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- def equals(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef → Any
- final def getClass(): Class[_ <: AnyRef]
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- def hashCode(): Int
- Definition Classes
- AnyRef → Any
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def isInstanceOf[T0]: Boolean
- Definition Classes
- Any
- final def ne(arg0: AnyRef): Boolean
- Definition Classes
- AnyRef
- final def notify(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def notifyAll(): Unit
- Definition Classes
- AnyRef
- Annotations
- @native() @HotSpotIntrinsicCandidate()
- final def synchronized[T0](arg0: => T0): T0
- Definition Classes
- AnyRef
- def toString(): String
- Definition Classes
- AnyRef → Any
- final def wait(arg0: Long, arg1: Int): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
- final def wait(arg0: Long): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException]) @native()
- final def wait(): Unit
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.InterruptedException])
Deprecated Value Members
- def finalize(): Unit
- Attributes
- protected[lang]
- Definition Classes
- AnyRef
- Annotations
- @throws(classOf[java.lang.Throwable]) @Deprecated
- Deprecated