ByteReader

trait ByteReader[F[_]]

Helper methods to read binary data from an input stream.

Companion:
object
class Object
trait Matchable
class Any
object IteratorByteReader.type
object LazyListByteReader.type

Type members

Types

type ParseResult[T] = Either[String, (F[Int], T)]
type ParseState[E, T] = State[F[Int], E, T]

Value members

Abstract methods

def fromInputStream(is: InputStream): F[Int]

Generates a sequence of bytes from a byte stream

Generates a sequence of bytes from a byte stream

def isEmpty[A](seq: F[A]): Boolean

Checks if a byte sequence is empty

Checks if a byte sequence is empty

def pushBytes(bytes: Seq[Int]): ParseState[Nothing, Unit]

Adds a sequence of bytes to the head of the byte stream

Adds a sequence of bytes to the head of the byte stream

def readBytes(n: Int): ParseState[Nothing, Array[Int]]

Read N Byte

Read N Byte

def readWhile(p: Int => Boolean): ParseState[Nothing, List[Int]]

Reads data while a predicate is true

Reads data while a predicate is true

def skipBytes(n: Int): ParseState[Nothing, Unit]

Skip N Bytes

Skip N Bytes

Concrete methods

def readBENumber(n: Int): ParseState[Nothing, Int]

Read a Integer N Bytes (Big Endian)

Read a Integer N Bytes (Big Endian)

def readLENumber(n: Int): ParseState[Nothing, Int]

Read a Integer N Bytes (Little Endian)

Read a Integer N Bytes (Little Endian)

def readString(n: Int): ParseState[Nothing, String]

Read a String from N Bytes

Read a String from N Bytes

Abstract fields

Read 1 Byte

Read 1 Byte