Chunk

object Chunk extends CollectorK[[O] =>> Chunk[O]] with ChunkCompanionPlatform
Companion
class
trait ChunkCompanionPlatform
trait CollectorK[[O] =>> Chunk[O]]
class Object
trait Matchable
class Any

Type members

Classlikes

Optional mix-in that provides the class tag of the element type in a chunk.
final class Singleton[O](val value: O) extends Chunk[O]
final case class Boxed[O](values: Array[O], offset: Int, length: Int) extends Chunk[O]
Companion
object
object Boxed
Companion
class
final case class Booleans(values: Array[Boolean], offset: Int, length: Int) extends Chunk[Boolean] with KnownElementType[Boolean]
Companion
object
object Booleans
Companion
class
final case class Bytes(values: Array[Byte], offset: Int, length: Int) extends Chunk[Byte] with KnownElementType[Byte]
Companion
object
object Bytes
Companion
class
sealed abstract class Buffer[A <: Buffer[A, B, C], B <: Buffer, C](buf: B, val offset: Int, val size: Int)(evidence$2: ClassTag[C]) extends Chunk[C] with KnownElementType[C]
object ShortBuffer
Companion
class
final case class ShortBuffer(buf: ShortBuffer, offset: Int, size: Int) extends Buffer[ShortBuffer, ShortBuffer, Short]
Companion
object
object LongBuffer
Companion
class
final case class LongBuffer(buf: LongBuffer, offset: Int, size: Int) extends Buffer[LongBuffer, LongBuffer, Long]
Companion
object
object DoubleBuffer
Companion
class
final case class DoubleBuffer(buf: DoubleBuffer, offset: Int, size: Int) extends Buffer[DoubleBuffer, DoubleBuffer, Double]
Companion
object
object FloatBuffer
Companion
class
final case class FloatBuffer(buf: FloatBuffer, offset: Int, size: Int) extends Buffer[FloatBuffer, FloatBuffer, Float]
Companion
object
object IntBuffer
Companion
class
final case class IntBuffer(buf: IntBuffer, offset: Int, size: Int) extends Buffer[IntBuffer, IntBuffer, Int]
Companion
object
object CharBuffer
Companion
class
final case class CharBuffer(buf: CharBuffer, offset: Int, size: Int) extends Buffer[CharBuffer, CharBuffer, Char]
Companion
object
object ByteBuffer
Companion
class
final case class ByteBuffer extends Buffer[ByteBuffer, ByteBuffer, Byte]
Companion
object
final case class Shorts(values: Array[Short], offset: Int, length: Int) extends Chunk[Short] with KnownElementType[Short]
Companion
object
object Shorts
Companion
class
final case class Ints(values: Array[Int], offset: Int, length: Int) extends Chunk[Int] with KnownElementType[Int]
Companion
object
object Ints
Companion
class
final case class Longs(values: Array[Long], offset: Int, length: Int) extends Chunk[Long] with KnownElementType[Long]
Companion
object
object Longs
Companion
class
final case class Floats(values: Array[Float], offset: Int, length: Int) extends Chunk[Float] with KnownElementType[Float]
Companion
object
object Floats
Companion
class
final case class Doubles(values: Array[Double], offset: Int, length: Int) extends Chunk[Double] with KnownElementType[Double]
Companion
object
object Doubles
Companion
class
final case class Chars(values: Array[Char], offset: Int, length: Int) extends Chunk[Char] with KnownElementType[Char]
Companion
object
object Chars
Companion
class
final case class ByteVectorChunk(toByteVector: ByteVector) extends Chunk[Byte] with KnownElementType[Byte]
final class Queue[A]
A FIFO queue of chunks that provides an O(1) size method and provides the ability to
take and drop individual elements while preserving the chunk structure as much as possible.
This is similar to a queue of individual elements but chunk structure is maintained.
Companion
object
object Queue
Companion
class

Value members

Methods

def empty[A]: Chunk[A]
Chunk with no elements.
def singleton[O](o: O): Chunk[O]
Creates a chunk consisting of a single element.
def vector[O](v: Vector[O]): Chunk[O]
Creates a chunk backed by a vector.
def indexedSeq[O](s: IndexedSeq[O]): Chunk[O]
Creates a chunk backed by an IndexedSeq.
def seq[O](s: Seq[O]): Chunk[O]
Creates a chunk from a scala.collection.Seq.
def iterable[O](i: Iterable[O]): Chunk[O]
Creates a chunk from a scala.collection.Iterable.
def arraySeq[O](arraySeq: ArraySeq[O]): Chunk[O]
Creates a chunk backed by a mutable ArraySeq.
def chain[O](c: Chain[O]): Chunk[O]
Creates a chunk backed by a Chain.
def buffer[O](b: Buffer[O]): Chunk[O]
Creates a chunk backed by a mutable buffer. The underlying buffer must not be modified after
it is passed to this function.
def apply[O](os: O*): Chunk[O]
Creates a chunk with the specified values.
def array[O](values: Array[O]): Chunk[O]
Creates a chunk backed by an array.
def array[O](values: Array[O], offset: Int, length: Int): Chunk[O]
Creates a chunk backed by an array.
def boxed[O](values: Array[O]): Chunk[O]
Creates a chunk backed by an array. If O is a primitive type, elements will be boxed.
def boxed[O](values: Array[O], offset: Int, length: Int): Chunk[O]
Creates a chunk backed by a subsequence of an array. If A is a primitive type, elements will be boxed.
def booleans(values: Array[Boolean]): Chunk[Boolean]
Creates a chunk backed by an array of booleans.
def booleans(values: Array[Boolean], offset: Int, length: Int): Chunk[Boolean]
Creates a chunk backed by a subsequence of an array of booleans.
def bytes(values: Array[Byte]): Chunk[Byte]
Creates a chunk backed by an array of bytes.
def bytes(values: Array[Byte], offset: Int, length: Int): Chunk[Byte]
Creates a chunk backed by a subsequence of an array of bytes.
def shortBuffer(buf: ShortBuffer): Chunk[Short]
Creates a chunk backed by an short buffer, bounded by the current position and limit
def longBuffer(buf: LongBuffer): Chunk[Long]
Creates a chunk backed by an long buffer, bounded by the current position and limit
def doubleBuffer(buf: DoubleBuffer): Chunk[Double]
Creates a chunk backed by an double buffer, bounded by the current position and limit
def floatBuffer(buf: FloatBuffer): Chunk[Float]
Creates a chunk backed by an float buffer, bounded by the current position and limit
def intBuffer(buf: IntBuffer): Chunk[Int]
Creates a chunk backed by an int buffer, bounded by the current position and limit
def charBuffer(buf: CharBuffer): Chunk[Char]
Creates a chunk backed by an char buffer, bounded by the current position and limit
def byteBuffer(buf: ByteBuffer): Chunk[Byte]
Creates a chunk backed by an byte buffer, bounded by the current position and limit
def shorts(values: Array[Short]): Chunk[Short]
Creates a chunk backed by an array of shorts.
def shorts(values: Array[Short], offset: Int, length: Int): Chunk[Short]
Creates a chunk backed by a subsequence of an array of shorts.
def ints(values: Array[Int]): Chunk[Int]
Creates a chunk backed by an array of ints.
def ints(values: Array[Int], offset: Int, length: Int): Chunk[Int]
Creates a chunk backed by a subsequence of an array of ints.
def longs(values: Array[Long]): Chunk[Long]
Creates a chunk backed by an array of longs.
def longs(values: Array[Long], offset: Int, length: Int): Chunk[Long]
Creates a chunk backed by a subsequence of an array of ints.
def floats(values: Array[Float]): Chunk[Float]
Creates a chunk backed by an array of floats.
def floats(values: Array[Float], offset: Int, length: Int): Chunk[Float]
Creates a chunk backed by a subsequence of an array of floats.
def doubles(values: Array[Double]): Chunk[Double]
Creates a chunk backed by an array of doubles.
def doubles(values: Array[Double], offset: Int, length: Int): Chunk[Double]
Creates a chunk backed by a subsequence of an array of doubles.
def chars(values: Array[Char]): Chunk[Char]
Creates a chunk backed by an array of chars.
def chars(values: Array[Char], offset: Int, length: Int): Chunk[Char]
Creates a chunk backed by a subsequence of an array of chars.
def byteVector(bv: ByteVector): Chunk[Byte]
Creates a chunk backed by a byte vector.
def concat[A](chunks: Seq[Chunk[A]]): Chunk[A]
Concatenates the specified sequence of chunks in to a single chunk, avoiding boxing.
def concat[A](chunks: Seq[Chunk[A]], totalSize: Int): Chunk[A]
Concatenates the specified sequence of chunks in to a single chunk, avoiding boxing.
The totalSize parameter must be equal to the sum of the size of each chunk or
otherwise an exception may be thrown.
def concatBooleans(chunks: Seq[Chunk[Boolean]]): Chunk[Boolean]
Concatenates the specified sequence of boolean chunks in to a single chunk.
def concatBooleans(chunks: Seq[Chunk[Boolean]], totalSize: Int): Chunk[Boolean]
Concatenates the specified sequence of boolean chunks in to a single chunk.
The totalSize parameter must be equal to the sum of the size of each chunk or
otherwise an exception may be thrown.
def concatBytes(chunks: Seq[Chunk[Byte]]): Chunk[Byte]
Concatenates the specified sequence of byte chunks in to a single chunk.
def concatBytes(chunks: Seq[Chunk[Byte]], totalSize: Int): Chunk[Byte]
Concatenates the specified sequence of byte chunks in to a single chunk.
The totalSize parameter must be equal to the sum of the size of each chunk or
otherwise an exception may be thrown.
def concatFloats(chunks: Seq[Chunk[Float]]): Chunk[Float]
Concatenates the specified sequence of float chunks in to a single chunk.
def concatFloats(chunks: Seq[Chunk[Float]], totalSize: Int): Chunk[Float]
Concatenates the specified sequence of float chunks in to a single chunk.
The totalSize parameter must be equal to the sum of the size of each chunk or
otherwise an exception may be thrown.
def concatDoubles(chunks: Seq[Chunk[Double]]): Chunk[Double]
Concatenates the specified sequence of double chunks in to a single chunk.
def concatDoubles(chunks: Seq[Chunk[Double]], totalSize: Int): Chunk[Double]
Concatenates the specified sequence of double chunks in to a single chunk.
The totalSize parameter must be equal to the sum of the size of each chunk or
otherwise an exception may be thrown.
def concatShorts(chunks: Seq[Chunk[Short]]): Chunk[Short]
Concatenates the specified sequence of short chunks in to a single chunk.
def concatShorts(chunks: Seq[Chunk[Short]], totalSize: Int): Chunk[Short]
Concatenates the specified sequence of short chunks in to a single chunk.
The totalSize parameter must be equal to the sum of the size of each chunk or
otherwise an exception may be thrown.
def concatInts(chunks: Seq[Chunk[Int]]): Chunk[Int]
Concatenates the specified sequence of int chunks in to a single chunk.
def concatInts(chunks: Seq[Chunk[Int]], totalSize: Int): Chunk[Int]
Concatenates the specified sequence of int chunks in to a single chunk.
The totalSize parameter must be equal to the sum of the size of each chunk or
otherwise an exception may be thrown.
def concatLongs(chunks: Seq[Chunk[Long]]): Chunk[Long]
Concatenates the specified sequence of long chunks in to a single chunk.
def concatLongs(chunks: Seq[Chunk[Long]], totalSize: Int): Chunk[Long]
Concatenates the specified sequence of long chunks in to a single chunk.
The totalSize parameter must be equal to the sum of the size of each chunk or
otherwise an exception may be thrown.
def concatChars(chunks: Seq[Chunk[Char]]): Chunk[Char]
Concatenates the specified sequence of char chunks in to a single chunk.
def concatChars(chunks: Seq[Chunk[Char]], totalSize: Int): Chunk[Char]
Concatenates the specified sequence of char chunks in to a single chunk.
The totalSize parameter must be equal to the sum of the size of each chunk or
otherwise an exception may be thrown.
def queue[A](queue: Queue[A]): Chunk[A]
Creates a chunk consisting of the elements of queue.
def queueFirstN[A](queue: Queue[A], n: Int): (Chunk[A], Queue[A])
Creates a chunk consisting of the first n elements of queue and returns the remainder.
def newBuilder[A]: Builder[A, Chunk[A]]

Inherited methods

def arraySeq[O](arraySeq: ArraySeq[O]): Chunk[O]
Creates a chunk backed by an immutable ArraySeq.
Inhertied from
ChunkCompanionPlatform
protected def platformIterable[O](i: Iterable[O]): Option[Chunk[O]]
Inhertied from
ChunkCompanionPlatform

Implicits

Implicits

implicit def fs2EqForChunk[A](evidence$4: Eq[A]): Eq[Chunk[A]]
implicit val instance: Traverse[[O] =>> Chunk[O]] & Monad[[O] =>> Chunk[O]] & Alternative[[O] =>> Chunk[O]] & TraverseFilter[[O] =>> Chunk[O]]
Traverse, Monad, Alternative, and TraverseFilter instance for Chunk.
Example
{{{
scala> import cats.syntax.all., scala.util.
scala> Chunk("1", "2", "NaN").mapFilter(s => Try(s.toInt).toOption)
res0: fs2.Chunk[Int] = Chunk(1, 2)
}}}