Chunk
- Companion
- class
Type members
Classlikes
final case class Booleans(values: Array[Boolean], offset: Int, length: Int) extends Chunk[Boolean] with KnownElementType[Boolean]
- Companion
- object
final case class Bytes(values: Array[Byte], offset: Int, length: Int) extends Chunk[Byte] with KnownElementType[Byte]
- Companion
- object
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]
final case class ShortBuffer(buf: ShortBuffer, offset: Int, size: Int) extends Buffer[ShortBuffer, ShortBuffer, Short]
- Companion
- object
final case class LongBuffer(buf: LongBuffer, offset: Int, size: Int) extends Buffer[LongBuffer, LongBuffer, Long]
- Companion
- object
final case class DoubleBuffer(buf: DoubleBuffer, offset: Int, size: Int) extends Buffer[DoubleBuffer, DoubleBuffer, Double]
- Companion
- object
final case class FloatBuffer(buf: FloatBuffer, offset: Int, size: Int) extends Buffer[FloatBuffer, FloatBuffer, Float]
- Companion
- object
final case class IntBuffer(buf: IntBuffer, offset: Int, size: Int) extends Buffer[IntBuffer, IntBuffer, Int]
- Companion
- object
final case class CharBuffer(buf: CharBuffer, offset: Int, size: Int) extends Buffer[CharBuffer, CharBuffer, Char]
- Companion
- object
final case class Shorts(values: Array[Short], offset: Int, length: Int) extends Chunk[Short] with KnownElementType[Short]
- Companion
- object
final case class Ints(values: Array[Int], offset: Int, length: Int) extends Chunk[Int] with KnownElementType[Int]
- Companion
- object
final case class Longs(values: Array[Long], offset: Int, length: Int) extends Chunk[Long] with KnownElementType[Long]
- Companion
- object
final case class Floats(values: Array[Float], offset: Int, length: Int) extends Chunk[Float] with KnownElementType[Float]
- Companion
- object
final case class Doubles(values: Array[Double], offset: Int, length: Int) extends Chunk[Double] with KnownElementType[Double]
- Companion
- object
final case class Chars(values: Array[Char], offset: Int, length: Int) extends Chunk[Char] with KnownElementType[Char]
- Companion
- object
final case class ByteVectorChunk(toByteVector: ByteVector) extends Chunk[Byte] with KnownElementType[Byte]
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.
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
Value members
Methods
Creates a chunk backed by a mutable buffer. The underlying buffer must not be modified after
it is passed to this function.
it is passed to this function.
Creates a chunk backed by a subsequence of an array. If
A
is a primitive type, elements will be boxed.Concatenates the specified sequence of chunks in to a single chunk, avoiding boxing.
The
otherwise an exception may be thrown.
The
totalSize
parameter must be equal to the sum of the size of each chunk orotherwise an exception may be thrown.
Concatenates the specified sequence of boolean chunks in to a single chunk.
The
otherwise an exception may be thrown.
The
totalSize
parameter must be equal to the sum of the size of each chunk orotherwise an exception may be thrown.
Concatenates the specified sequence of byte chunks in to a single chunk.
The
otherwise an exception may be thrown.
The
totalSize
parameter must be equal to the sum of the size of each chunk orotherwise an exception may be thrown.
Concatenates the specified sequence of float chunks in to a single chunk.
The
otherwise an exception may be thrown.
The
totalSize
parameter must be equal to the sum of the size of each chunk orotherwise an exception may be thrown.
Concatenates the specified sequence of double chunks in to a single chunk.
The
otherwise an exception may be thrown.
The
totalSize
parameter must be equal to the sum of the size of each chunk orotherwise an exception may be thrown.
Concatenates the specified sequence of short chunks in to a single chunk.
The
otherwise an exception may be thrown.
The
totalSize
parameter must be equal to the sum of the size of each chunk orotherwise an exception may be thrown.
Concatenates the specified sequence of int chunks in to a single chunk.
The
otherwise an exception may be thrown.
The
totalSize
parameter must be equal to the sum of the size of each chunk orotherwise an exception may be thrown.
Concatenates the specified sequence of long chunks in to a single chunk.
The
otherwise an exception may be thrown.
The
totalSize
parameter must be equal to the sum of the size of each chunk orotherwise an exception may be thrown.
Concatenates the specified sequence of char chunks in to a single chunk.
The
otherwise an exception may be thrown.
The
totalSize
parameter must be equal to the sum of the size of each chunk orotherwise an exception may be thrown.
Implicits
Implicits
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)
}}}