FromByteVector

io.bullet.borer.compat.scodec.FromByteVector
final class FromByteVector(byteVector: ByteVector) extends Input[ByteVector]

Attributes

Graph
Supertypes
trait Input[ByteVector]
class Object
trait Matchable
class Any

Members list

Value members

Concrete methods

def cursor: Long

The index of the next byte to be read.

The index of the next byte to be read.

Attributes

def readByte(): Byte

Returns the next byte, if possible without any range checks. Advances the cursor by 1.

Returns the next byte, if possible without any range checks. Advances the cursor by 1.

Attributes

def readBytePadded(pp: PaddingProvider[ByteVector]): Byte

Returns the next byte if not out-of-range, otherwise the one returned by the given Input.PaddingProvider.

Returns the next byte if not out-of-range, otherwise the one returned by the given Input.PaddingProvider.

Attributes

def readBytes(length: Long, pp: PaddingProvider[ByteVector]): ByteVector

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.

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.

Attributes

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.

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.

Attributes

def readDoubleByteBigEndianPadded(pp: PaddingProvider[ByteVector]): Char

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.

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.

Attributes

def readOctaByteBigEndian(): Long

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.

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.

Attributes

def readOctaByteBigEndianPadded(pp: PaddingProvider[ByteVector]): Long

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.

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.

Attributes

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.

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.

Attributes

def readQuadByteBigEndianPadded(pp: PaddingProvider[ByteVector]): Int

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.

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.

Attributes

def unread(numberOfBytes: Int): FromByteVector.this.type

"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.

"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 ???.

Attributes