ByteStrings

org.apache.pekko.util.ByteString.ByteStrings
final class ByteStrings extends ByteString, Serializable

A ByteString with 2 or more fragments.

Attributes

Source
ByteString.scala
Graph
Supertypes

Members list

Value members

Concrete methods

def ++(that: ByteString): ByteString

Efficiently concatenate another ByteString.

Efficiently concatenate another ByteString.

Attributes

Source
ByteString.scala
def apply(idx: Int): Byte

Attributes

Source
ByteString.scala
def asByteBuffer: ByteBuffer

Returns a read-only ByteBuffer that directly wraps this ByteString if it is not fragmented.

Returns a read-only ByteBuffer that directly wraps this ByteString if it is not fragmented.

Attributes

Source
ByteString.scala
def asByteBuffers: Iterable[ByteBuffer]

Scala API: Returns an immutable Iterable of read-only ByteBuffers that directly wraps this ByteStrings all fragments. Will always have at least one entry.

Scala API: Returns an immutable Iterable of read-only ByteBuffers that directly wraps this ByteStrings all fragments. Will always have at least one entry.

Attributes

Source
ByteString.scala
override def asInputStream: InputStream

Return the bytes in this ByteString as an InputStream.

Return the bytes in this ByteString as an InputStream.

Attributes

Returns

the bytes in this ByteString accessible as an InputStream

See also
Since

1.1.0

Definition Classes
Source
ByteString.scala

Create a new ByteString with all contents compacted into a single, full byte array. If isCompact returns true, compact is an O(1) operation, but might return a different object with an optimized implementation.

Create a new ByteString with all contents compacted into a single, full byte array. If isCompact returns true, compact is an O(1) operation, but might return a different object with an optimized implementation.

Attributes

Source
ByteString.scala
override def copyToArray[B >: Byte](dest: Array[B], start: Int, len: Int): Int

Attributes

Definition Classes
Source
ByteString.scala
override def copyToBuffer(buffer: ByteBuffer): Int

Copy as many bytes as possible to a ByteBuffer, starting from it's current position. This method will not overflow the buffer.

Copy as many bytes as possible to a ByteBuffer, starting from it's current position. This method will not overflow the buffer.

Value parameters

buffer

a ByteBuffer to copy bytes to

Attributes

Returns

the number of bytes actually copied

Definition Classes
Source
ByteString.scala
override def copyToBuffer(buffer: ByteBuffer, offset: Int): Int

Copy as many bytes as possible to a ByteBuffer, starting from a given offset within this ByteString and the buffer's current position. This method will not overflow the buffer.

Copy as many bytes as possible to a ByteBuffer, starting from a given offset within this ByteString and the buffer's current position. This method will not overflow the buffer.

Value parameters

buffer

a ByteBuffer to copy bytes to

offset

the offset within this ByteString to start copying from

Attributes

Returns

the number of bytes actually copied

Since

2.0.0

Definition Classes
Source
ByteString.scala
override def decodeBase64: ByteString

Returns a ByteString which is the binary representation of this ByteString if this ByteString is Base64-encoded.

Returns a ByteString which is the binary representation of this ByteString if this ByteString is Base64-encoded.

Attributes

Definition Classes
Source
ByteString.scala
def decodeString(charset: String): String

Decodes this ByteString using a charset to produce a String. If you have a Charset instance available, use decodeString(charset: java.nio.charset.Charset instead.

Decodes this ByteString using a charset to produce a String. If you have a Charset instance available, use decodeString(charset: java.nio.charset.Charset instead.

Attributes

Source
ByteString.scala
def decodeString(charset: Charset): String

Decodes this ByteString using a charset to produce a String. Avoids Charset.forName lookup in String internals, thus is preferable to decodeString(charset: String).

Decodes this ByteString using a charset to produce a String. Avoids Charset.forName lookup in String internals, thus is preferable to decodeString(charset: String).

Attributes

Source
ByteString.scala
override def drop(n: Int): ByteString

Attributes

Definition Classes
Source
ByteString.scala
override def dropRight(n: Int): ByteString

Attributes

Definition Classes
Source
ByteString.scala
override def encodeBase64: ByteString

Returns a ByteString which is the Base64 representation of this ByteString

Returns a ByteString which is the Base64 representation of this ByteString

Attributes

Definition Classes
Source
ByteString.scala
override def endsWith(bytes: Array[Byte]): Boolean

Tests whether this ByteString ends with the given bytes.

Tests whether this ByteString ends with the given bytes.

Value parameters

bytes

the slice to test

Attributes

Returns

true if this ByteString ends with the given bytes

Since

2.0.0

Definition Classes
Source
ByteString.scala
override def foreach[U](f: Byte => U): Unit

Attributes

Definition Classes
Source
ByteString.scala
override def indexOf[B >: Byte](elem: B, from: Int): Int

Attributes

Definition Classes
Source
ByteString.scala
override def indexOf(elem: Byte, from: Int): Int

Finds index of first occurrence of some byte in this ByteString after or at some start index.

Finds index of first occurrence of some byte in this ByteString after or at some start index.

Similar to Seq's indexOf, but it avoids boxing if the value is already a byte.

Value parameters

elem

the element value to search for.

from

the start index

Attributes

Returns

the index >= from of the first element of this ByteString that is equal (as determined by ==) to elem, or -1, if none exists.

Since

1.1.0

Definition Classes
Source
ByteString.scala
override def indexOf(elem: Byte, from: Int, to: Int): Int

Finds index of first occurrence of some byte in this ByteString after or at some start index. This overload allows you to specify an end index (exclusive).

Finds index of first occurrence of some byte in this ByteString after or at some start index. This overload allows you to specify an end index (exclusive).

Value parameters

elem

the element value to search for.

from

the start index

to

the end index (exclusive)

Attributes

Returns

the index >= from and < to of the first element of this ByteString that is equal (as determined by ==) to elem, or -1, if none exists.

Since

1.3.0

Definition Classes
Source
ByteString.scala

Check whether this ByteString is compact in memory. If the ByteString is compact, it might, however, not be represented by an object that takes full advantage of that fact. Use compact to get such an object.

Check whether this ByteString is compact in memory. If the ByteString is compact, it might, however, not be represented by an object that takes full advantage of that fact. Use compact to get such an object.

Attributes

Source
ByteString.scala

Avoid iterator in performance sensitive code, call ops directly on ByteString instead

Avoid iterator in performance sensitive code, call ops directly on ByteString instead

Attributes

Definition Classes
Source
ByteString.scala
override def lastIndexOf[B >: Byte](elem: B, end: Int): Int

Attributes

Definition Classes
Source
ByteString.scala
override def lastIndexOf(elem: Byte, end: Int): Int

Finds index of last occurrence of some byte in this ByteString before or at some end index.

Finds index of last occurrence of some byte in this ByteString before or at some end index.

Similar to lastIndexOf, but it avoids boxing if the value is already a byte.

Value parameters

elem

the element value to search for.

end

the end index (inclusive)

Attributes

Returns

the index <= end of the last element of this ByteString that is equal (as determined by ==) to elem, or -1, if none exists.

Since

2.0.0

Definition Classes
Source
ByteString.scala
override def map[A](f: Byte => Byte): ByteString

Attributes

Definition Classes
Source
ByteString.scala
override def slice(from: Int, until: Int): ByteString

Attributes

Definition Classes
Source
ByteString.scala
override def startsWith(bytes: Array[Byte], offset: Int): Boolean

Tests whether this ByteString starts with the given slice.

Tests whether this ByteString starts with the given slice.

Value parameters

bytes

the slice to test

offset

the offset to start testing from

Attributes

Returns

true if this ByteString starts with the given slice

Since

2.0.0

Definition Classes
Source
ByteString.scala
override def take(n: Int): ByteString

Attributes

Definition Classes
Source
ByteString.scala

Inherited methods

final def ++[B >: Byte](suffix: IterableOnce[B]): IndexedSeq[B]

Attributes

Inherited from:
IterableOps
final override def ++:[B >: Byte](prefix: IterableOnce[B]): IndexedSeq[B]

Attributes

Definition Classes
Inherited from:
SeqOps
final def +:[B >: Byte](elem: B): IndexedSeq[B]

Attributes

Inherited from:
SeqOps
final def :+[B >: Byte](elem: B): IndexedSeq[B]

Attributes

Inherited from:
SeqOps
final def :++[B >: Byte](suffix: IterableOnce[B]): IndexedSeq[B]

Attributes

Inherited from:
SeqOps
final def addString(b: StringBuilder): b.type

Attributes

Inherited from:
IterableOnceOps
final def addString(b: StringBuilder, sep: String): b.type

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
PartialFunction
override def andThen[C](k: Byte => C): PartialFunction[Int, C]

Attributes

Definition Classes
Inherited from:
PartialFunction
override def appended[B >: Byte](elem: B): IndexedSeq[B]

Attributes

Definition Classes
Inherited from:
StrictOptimizedSeqOps
override def appendedAll[B >: Byte](suffix: IterableOnce[B]): IndexedSeq[B]

Attributes

Definition Classes
Inherited from:
StrictOptimizedSeqOps
def applyOrElse[A1 <: Int, B1 >: Byte](x: A1, default: A1 => B1): B1

Attributes

Inherited from:
PartialFunction
override def canEqual(that: Any): Boolean

Attributes

Definition Classes
Inherited from:
IndexedSeq
final override def className: String

Attributes

Definition Classes
Inherited from:
ByteString
Source
ByteString.scala
override def collect[B](pf: PartialFunction[Byte, B]): IndexedSeq[B]

Attributes

Definition Classes
Inherited from:
StrictOptimizedIterableOps

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
SeqOps

Attributes

Inherited from:
PartialFunction
def compose[A](g: A => Int): A => Byte

Attributes

Inherited from:
Function1

Java API: efficiently concatenate another ByteString.

Java API: efficiently concatenate another ByteString.

Attributes

Inherited from:
ByteString
Source
ByteString.scala
final override def concat[B >: Byte](suffix: IterableOnce[B]): IndexedSeq[B]

Attributes

Definition Classes
Inherited from:
SeqOps
def contains(elem: Byte): Boolean

Checks if this ByteString contains a specific byte. Similar to Seq's contains function, but it avoids boxing if the value is already a byte.

Checks if this ByteString contains a specific byte. Similar to Seq's contains function, but it avoids boxing if the value is already a byte.

Attributes

Since

2.0.0

Inherited from:
ByteString
Source
ByteString.scala
override def contains[B >: Byte](elem: B): Boolean

Attributes

Definition Classes
Inherited from:
ByteString
Source
ByteString.scala

Attributes

Inherited from:
SeqOps
final override def copyToArray[B >: Byte](xs: Array[B], start: Int): Int

Attributes

Definition Classes
Inherited from:
ByteString
Source
ByteString.scala
def copyToArray[B >: Byte](xs: Array[B]): Int

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOnceOps
def corresponds[B](that: Seq[B])(p: (Byte, B) => Boolean): Boolean

Attributes

Inherited from:
SeqOps
def count(p: Byte => Boolean): Int

Attributes

Inherited from:
IterableOnceOps
override def diff[B >: Byte](that: Seq[B]): ByteString

Attributes

Definition Classes
Inherited from:
StrictOptimizedSeqOps

Attributes

Inherited from:
SeqOps
override def distinctBy[B](f: Byte => B): ByteString

Attributes

Definition Classes
Inherited from:
StrictOptimizedSeqOps
override def dropWhile(p: Byte => Boolean): ByteString

Attributes

Definition Classes
Inherited from:
ByteString
Source
ByteString.scala

Attributes

Inherited from:
PartialFunction
override def empty: ByteString

Attributes

Definition Classes
Inherited from:
ByteString
Source
ByteString.scala
override def endsWith[B >: Byte](iterable: Iterable[B]): Boolean

Attributes

Definition Classes
Inherited from:
ByteString
Source
ByteString.scala
override def equals(o: Any): Boolean

Compares the receiver object (this) with the argument object (that) for equivalence.

Compares the receiver object (this) with the argument object (that) for equivalence.

Any implementation of this method should be an equivalence relation:

  • It is reflexive: for any instance x of type Any, x.equals(x) should return true.
  • It is symmetric: for any instances x and y of type Any, x.equals(y) should return true if and only if y.equals(x) returns true.
  • It is transitive: for any instances x, y, and z of type Any if x.equals(y) returns true and y.equals(z) returns true, then x.equals(z) should return true.

If you override this method, you should verify that your implementation remains an equivalence relation. Additionally, when overriding this method it is usually necessary to override hashCode to ensure that objects which are "equal" (o1.equals(o2) returns true) hash to the same scala.Int. (o1.hashCode.equals(o2.hashCode)).

Value parameters

that

the object to compare against this object for equality.

Attributes

Returns

true if the receiver object is equivalent to the argument; false otherwise.

Definition Classes
Seq -> Equals -> Any
Inherited from:
Seq

Attributes

Inherited from:
IterableOnceOps
override def filter(pred: Byte => Boolean): ByteString

Attributes

Definition Classes
Inherited from:
StrictOptimizedIterableOps
override def filterNot(pred: Byte => Boolean): ByteString

Attributes

Definition Classes
Inherited from:
StrictOptimizedIterableOps
def find(p: Byte => Boolean): Option[Byte]

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
SeqOps
override def flatMap[B](f: Byte => IterableOnce[B]): IndexedSeq[B]

Attributes

Definition Classes
Inherited from:
StrictOptimizedIterableOps
override def flatten[B](implicit toIterableOnce: Byte => IterableOnce[B]): IndexedSeq[B]

Attributes

Definition Classes
Inherited from:
StrictOptimizedIterableOps
def fold[A1 >: Byte](z: A1)(op: (A1, A1) => A1): A1

Attributes

Inherited from:
IterableOnceOps
def foldLeft[B](z: B)(op: (B, Byte) => B): B

Attributes

Inherited from:
IterableOnceOps
override def foldRight[B](z: B)(op: (Byte, B) => B): B

Attributes

Definition Classes
Inherited from:
IndexedSeqOps

Attributes

Inherited from:
IterableOnceOps
def getByteBuffers(): Iterable[ByteBuffer]

Java API: Returns an Iterable of read-only ByteBuffers that directly wraps this ByteStrings all fragments. Will always have at least one entry.

Java API: Returns an Iterable of read-only ByteBuffers that directly wraps this ByteStrings all fragments. Will always have at least one entry.

Attributes

Inherited from:
ByteString
Source
ByteString.scala
def groupBy[K](f: Byte => K): Map[K, ByteString]

Attributes

Inherited from:
IterableOps
def groupMap[K, B](key: Byte => K)(f: Byte => B): Map[K, IndexedSeq[B]]

Attributes

Inherited from:
IterableOps
def groupMapReduce[K, B](key: Byte => K)(f: Byte => B)(reduce: (B, B) => B): Map[K, B]

Attributes

Inherited from:
IterableOps
override def grouped(size: Int): Iterator[ByteString]

Attributes

Definition Classes
Inherited from:
ByteString
Source
ByteString.scala
override def head: Byte

Attributes

Definition Classes
Inherited from:
ByteString
Source
ByteString.scala
override def headOption: Option[Byte]

Attributes

Definition Classes
Inherited from:
IndexedSeqOps
def indexOf(elem: Byte): Int

Finds index of first occurrence of some byte in this ByteString.

Finds index of first occurrence of some byte in this ByteString.

Similar to Seq's indexOf, but it avoids boxing if the value is already a byte.

Value parameters

elem

the element value to search for.

Attributes

Returns

the index >= from of the first element of this ByteString that is equal (as determined by ==) to elem, or -1, if none exists.

Since

1.1.0

Inherited from:
ByteString
Source
ByteString.scala
def indexOf[B >: Byte](elem: B): Int

Attributes

Inherited from:
SeqOps
def indexOfSlice(slice: Array[Byte]): Int

Finds index of first occurrence of some slice in this ByteString.

Finds index of first occurrence of some slice in this ByteString.

Value parameters

slice

the slice to search for.

Attributes

Returns

the index of the first element of this ByteString that starts a slice equal (as determined by ==) to slice, or -1, if none exists.

Since

2.0.0

Inherited from:
ByteString
Source
ByteString.scala
def indexOfSlice(slice: Array[Byte], from: Int): Int

Finds index of first occurrence of some slice in this ByteString.

Finds index of first occurrence of some slice in this ByteString.

Value parameters

from

the start index

slice

the slice to search for.

Attributes

Returns

the index greater than or equal to from of the first element of this ByteString that starts a slice equal (as determined by ==) to slice, or -1, if none exists.

Since

2.0.0

Inherited from:
ByteString
Source
ByteString.scala
override def indexOfSlice[B >: Byte](slice: Seq[B], from: Int): Int

Attributes

Definition Classes
Inherited from:
ByteString
Source
ByteString.scala
def indexOfSlice[B >: Byte](that: Seq[B]): Int

Attributes

Inherited from:
SeqOps
override def indexWhere(p: Byte => Boolean, from: Int): Int

Attributes

Definition Classes
Inherited from:
ByteString
Source
ByteString.scala

Attributes

Inherited from:
SeqOps
def indices: Range

Attributes

Inherited from:
SeqOps
override def init: ByteString

Attributes

Definition Classes
Inherited from:
ByteString
Source
ByteString.scala

Attributes

Inherited from:
IterableOps
override def intersect[B >: Byte](that: Seq[B]): ByteString

Attributes

Definition Classes
Inherited from:
StrictOptimizedSeqOps

Attributes

Inherited from:
SeqOps
override def isEmpty: Boolean

Attributes

Definition Classes
Inherited from:
ByteString
Source
ByteString.scala
override def isTraversableAgain: Boolean

Attributes

Definition Classes
Inherited from:
IterableOps

Attributes

Definition Classes
Inherited from:
IndexedSeq
override def knownSize: Int

Attributes

Definition Classes
Inherited from:
IndexedSeqOps
override def last: Byte

Attributes

Definition Classes
Inherited from:
ByteString
Source
ByteString.scala
def lastIndexOf(elem: Byte): Int

Finds index of last occurrence of some byte in this ByteString.

Finds index of last occurrence of some byte in this ByteString.

Similar to lastIndexOf, but it avoids boxing if the value is already a byte.

Value parameters

elem

the element value to search for.

Attributes

Returns

the index of the last element of this ByteString that is equal (as determined by ==) to elem, or -1, if none exists.

Since

2.0.0

Inherited from:
ByteString
Source
ByteString.scala
def lastIndexOfSlice(slice: Array[Byte]): Int

Finds index of last occurrence of some slice in this ByteString.

Finds index of last occurrence of some slice in this ByteString.

Uses lastIndexOf on the last byte of the slice to efficiently find candidate positions, then verifies the full slice match.

Value parameters

slice

the slice to search for.

Attributes

Returns

the index of the last element of this ByteString that starts a slice equal (as determined by ==) to slice, or -1, if none exists.

Since

2.0.0

Inherited from:
ByteString
Source
ByteString.scala
def lastIndexOfSlice(slice: Array[Byte], end: Int): Int

Finds index of last occurrence of some slice in this ByteString before or at some end index.

Finds index of last occurrence of some slice in this ByteString before or at some end index.

Uses lastIndexOf on the last byte of the slice to efficiently find candidate positions, then verifies the full slice match.

Value parameters

end

the end index — the largest index at which the slice may start

slice

the slice to search for.

Attributes

Returns

the largest index <= end of the first element of this ByteString that starts a slice equal (as determined by ==) to slice, or -1, if none exists.

Since

2.0.0

Inherited from:
ByteString
Source
ByteString.scala
override def lastIndexOfSlice[B >: Byte](slice: Seq[B], end: Int): Int

Attributes

Definition Classes
Inherited from:
ByteString
Source
ByteString.scala
def lastIndexOfSlice[B >: Byte](that: Seq[B]): Int

Attributes

Inherited from:
SeqOps

Attributes

Inherited from:
SeqOps

Attributes

Inherited from:
SeqOps

Attributes

Inherited from:
IterableOps
def lazyZip[B](that: Iterable[B]): LazyZip2[Byte, B, Iterable.this.type]

Attributes

Inherited from:
Iterable
final override def lengthCompare(that: Iterable[_]): Int

Attributes

Definition Classes
Inherited from:
IndexedSeqOps
final override def lengthCompare(len: Int): Int

Attributes

Definition Classes
Inherited from:
IndexedSeqOps

Attributes

Inherited from:
SeqOps
def lift: Int => Option[Byte]

Attributes

Inherited from:
PartialFunction
override def map[B](f: Byte => B): IndexedSeq[B]

Attributes

Definition Classes
Inherited from:
StrictOptimizedIterableOps
final def mapI(f: Byte => Int): ByteString

map method that will automatically cast Int back into Byte.

map method that will automatically cast Int back into Byte.

Attributes

Inherited from:
ByteString
Source
ByteString.scala
def max[B >: Byte](implicit ord: Ordering[B]): Byte

Attributes

Inherited from:
IterableOnceOps
def maxBy[B](f: Byte => B)(implicit ord: Ordering[B]): Byte

Attributes

Inherited from:
IterableOnceOps
def maxByOption[B](f: Byte => B)(implicit ord: Ordering[B]): Option[Byte]

Attributes

Inherited from:
IterableOnceOps
def maxOption[B >: Byte](implicit ord: Ordering[B]): Option[Byte]

Attributes

Inherited from:
IterableOnceOps
def min[B >: Byte](implicit ord: Ordering[B]): Byte

Attributes

Inherited from:
IterableOnceOps
def minBy[B](f: Byte => B)(implicit ord: Ordering[B]): Byte

Attributes

Inherited from:
IterableOnceOps
def minByOption[B](f: Byte => B)(implicit ord: Ordering[B]): Option[Byte]

Attributes

Inherited from:
IterableOnceOps
def minOption[B >: Byte](implicit ord: Ordering[B]): Option[Byte]

Attributes

Inherited from:
IterableOnceOps
final def mkString: String

Attributes

Inherited from:
IterableOnceOps
final def mkString(sep: String): String

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
PartialFunction
override def padTo[B >: Byte](len: Int, elem: B): IndexedSeq[B]

Attributes

Definition Classes
Inherited from:
StrictOptimizedSeqOps
override def partition(p: Byte => Boolean): (ByteString, ByteString)

Attributes

Definition Classes
Inherited from:
StrictOptimizedIterableOps
override def partitionMap[A1, A2](f: Byte => Either[A1, A2]): (IndexedSeq[A1], IndexedSeq[A2])

Attributes

Definition Classes
Inherited from:
StrictOptimizedIterableOps
override def patch[B >: Byte](from: Int, other: IterableOnce[B], replaced: Int): IndexedSeq[B]

Attributes

Definition Classes
Inherited from:
StrictOptimizedSeqOps

Attributes

Inherited from:
SeqOps
override def prepended[B >: Byte](elem: B): IndexedSeq[B]

Attributes

Definition Classes
Inherited from:
StrictOptimizedSeqOps
override def prependedAll[B >: Byte](prefix: IterableOnce[B]): IndexedSeq[B]

Attributes

Definition Classes
Inherited from:
StrictOptimizedSeqOps
def product[B >: Byte](implicit num: Numeric[B]): B

Attributes

Inherited from:
IterableOnceOps
def readIntBE(offset: Int): Int

Read an int from this ByteString at the given offset in big-endian byte order.

Read an int from this ByteString at the given offset in big-endian byte order.

Value parameters

offset

the offset to read from

Attributes

Returns

the int value

Throws
IndexOutOfBoundsException

if the offset is negative or there are fewer than 4 bytes available from offset

Since

2.0.0

Inherited from:
ByteString
Source
ByteString.scala
def readIntLE(offset: Int): Int

Read an int from this ByteString at the given offset in little-endian byte order.

Read an int from this ByteString at the given offset in little-endian byte order.

Value parameters

offset

the offset to read from

Attributes

Returns

the int value

Throws
IndexOutOfBoundsException

if the offset is negative or there are fewer than 4 bytes available from offset

Since

2.0.0

Inherited from:
ByteString
Source
ByteString.scala
def readLongBE(offset: Int): Long

Read a long from this ByteString at the given offset in big-endian byte order.

Read a long from this ByteString at the given offset in big-endian byte order.

Value parameters

offset

the offset to read from

Attributes

Returns

the long value

Throws
IndexOutOfBoundsException

if the offset is negative or there are fewer than 8 bytes available from offset

Since

2.0.0

Inherited from:
ByteString
Source
ByteString.scala
def readLongLE(offset: Int): Long

Read a long from this ByteString at the given offset in little-endian byte order.

Read a long from this ByteString at the given offset in little-endian byte order.

Value parameters

offset

the offset to read from

Attributes

Returns

the long value

Throws
IndexOutOfBoundsException

if the offset is negative or there are fewer than 8 bytes available from offset

Since

2.0.0

Inherited from:
ByteString
Source
ByteString.scala
def readShortBE(offset: Int): Short

Read a short from this ByteString at the given offset in big-endian byte order.

Read a short from this ByteString at the given offset in big-endian byte order.

Value parameters

offset

the offset to read from

Attributes

Returns

the short value

Throws
IndexOutOfBoundsException

if the offset is negative or there are fewer than 2 bytes available from offset

Since

2.0.0

Inherited from:
ByteString
Source
ByteString.scala
def readShortLE(offset: Int): Short

Read a short from this ByteString at the given offset in little-endian byte order.

Read a short from this ByteString at the given offset in little-endian byte order.

Value parameters

offset

the offset to read from

Attributes

Returns

the short value

Throws
IndexOutOfBoundsException

if the offset is negative or there are fewer than 2 bytes available from offset

Since

2.0.0

Inherited from:
ByteString
Source
ByteString.scala
def reduce[B >: Byte](op: (B, B) => B): B

Attributes

Inherited from:
IterableOnceOps
def reduceLeft[B >: Byte](op: (B, Byte) => B): B

Attributes

Inherited from:
IterableOnceOps
def reduceLeftOption[B >: Byte](op: (B, Byte) => B): Option[B]

Attributes

Inherited from:
IterableOnceOps
def reduceOption[B >: Byte](op: (B, B) => B): Option[B]

Attributes

Inherited from:
IterableOnceOps
def reduceRight[B >: Byte](op: (Byte, B) => B): B

Attributes

Inherited from:
IterableOnceOps
def reduceRightOption[B >: Byte](op: (Byte, B) => B): Option[B]

Attributes

Inherited from:
IterableOnceOps
override def reverse: ByteString

Attributes

Definition Classes
Inherited from:
IndexedSeqOps
override def reverseIterator: Iterator[Byte]

Attributes

Definition Classes
Inherited from:
IndexedSeqOps
override protected def reversed: Iterable[Byte]

Attributes

Definition Classes
Inherited from:
IndexedSeqOps
def runWith[U](action: Byte => U): Int => Boolean

Attributes

Inherited from:
PartialFunction
override def sameElements[B >: Byte](o: IterableOnce[B]): Boolean

Attributes

Definition Classes
Inherited from:
IndexedSeq

Attributes

Inherited from:
SeqOps
def scan[B >: Byte](z: B)(op: (B, B) => B): IndexedSeq[B]

Attributes

Inherited from:
IterableOps
override def scanLeft[B](z: B)(op: (B, Byte) => B): IndexedSeq[B]

Attributes

Definition Classes
Inherited from:
StrictOptimizedIterableOps
def scanRight[B](z: B)(op: (Byte, B) => B): IndexedSeq[B]

Attributes

Inherited from:
IterableOps
override def search[B >: Byte](elem: B, from: Int, to: Int)(implicit ord: Ordering[B]): SearchResult

Attributes

Definition Classes
Inherited from:
IndexedSeqOps
override def search[B >: Byte](elem: B)(implicit ord: Ordering[B]): SearchResult

Attributes

Definition Classes
Inherited from:
IndexedSeqOps

Attributes

Inherited from:
SeqOps
final def segmentLength(p: Byte => Boolean): Int

Attributes

Inherited from:
SeqOps
final override def size: Int

Attributes

Definition Classes
Inherited from:
SeqOps
final override def sizeCompare(that: Iterable[_]): Int

Attributes

Definition Classes
Inherited from:
SeqOps
final override def sizeCompare(otherSize: Int): Int

Attributes

Definition Classes
Inherited from:
SeqOps
final def sizeIs: SizeCompareOps

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps

Attributes

Inherited from:
IterableOps
def sortBy[B](f: Byte => B)(implicit ord: Ordering[B]): ByteString

Attributes

Inherited from:
SeqOps

Attributes

Inherited from:
SeqOps
override def sorted[B >: Byte](implicit ord: Ordering[B]): ByteString

Attributes

Definition Classes
Inherited from:
StrictOptimizedSeqOps
override def span(p: Byte => Boolean): (ByteString, ByteString)

Attributes

Definition Classes
Inherited from:
ByteString
Source
ByteString.scala
override def splitAt(n: Int): (ByteString, ByteString)

Attributes

Definition Classes
Inherited from:
ByteString
Source
ByteString.scala
def startsWith(bytes: Array[Byte]): Boolean

Tests whether this ByteString starts with the given slice.

Tests whether this ByteString starts with the given slice.

Value parameters

bytes

the slice to test

Attributes

Returns

true if this ByteString starts with the given slice

Since

2.0.0

Inherited from:
ByteString
Source
ByteString.scala
override def startsWith[B >: Byte](iterable: IterableOnce[B], offset: Int): Boolean

Attributes

Definition Classes
Inherited from:
ByteString
Source
ByteString.scala
override def stepper[S <: Stepper[_]](implicit shape: StepperShape[Byte, S]): S & EfficientSplit

Attributes

Definition Classes
Inherited from:
IndexedSeqOps
def sum[B >: Byte](implicit num: Numeric[B]): B

Attributes

Inherited from:
IterableOnceOps
override def tail: ByteString

Attributes

Definition Classes
Inherited from:
ByteString
Source
ByteString.scala

Attributes

Inherited from:
IterableOps
override def takeRight(n: Int): ByteString

Attributes

Definition Classes
Inherited from:
ByteString
Source
ByteString.scala
override def takeWhile(p: Byte => Boolean): ByteString

Attributes

Definition Classes
Inherited from:
ByteString
Source
ByteString.scala
override def tapEach[U](f: Byte => U): ByteString

Attributes

Definition Classes
Inherited from:
StrictOptimizedIterableOps
def to[C1](factory: Factory[Byte, C1]): C1

Attributes

Inherited from:
IterableOnceOps
final override def toArray[B >: Byte](implicit arg0: ClassTag[B]): Array[B]

Attributes

Definition Classes
Inherited from:
ByteString
Source
ByteString.scala

Unsafe API: Use only in situations you are completely confident that this is what you need, and that you understand the implications documented below.

Unsafe API: Use only in situations you are completely confident that this is what you need, and that you understand the implications documented below.

If the ByteString is backed by a single array it is returned without any copy. If it is backed by a rope of multiple ByteString instances a new array will be allocated and the contents will be copied into it before returning it.

This method of exposing the bytes of a ByteString can save one array copy and allocation in the happy path scenario which can lead to better performance, however it also means that one MUST NOT modify the returned array, or unexpected immutable data structure contract-breaking behavior will manifest itself.

This API is intended for users who need to pass the byte array to some other API, which will only read the bytes and never mutate then. For all other intents and purposes, please use the usual toArray method - which provide the immutability guarantees by copying the backing array.

Attributes

Inherited from:
ByteString
Source
ByteString.scala
final def toBuffer[B >: Byte]: Buffer[B]

Attributes

Inherited from:
IterableOnceOps
def toByteBuffer: ByteBuffer

Creates a new ByteBuffer with a copy of all bytes contained in this ByteString.

Creates a new ByteBuffer with a copy of all bytes contained in this ByteString.

Attributes

Inherited from:
ByteString
Source
ByteString.scala
final override def toIndexedSeq: IndexedSeq[Byte]

Attributes

Definition Classes
Inherited from:
IndexedSeq
def toList: List[Byte]

Attributes

Inherited from:
IterableOnceOps
def toMap[K, V](implicit ev: Byte <:< (K, V)): Map[K, V]

Attributes

Inherited from:
IterableOnceOps
final override def toSeq: Seq.this.type

Attributes

Definition Classes
Inherited from:
Seq
def toSet[B >: Byte]: Set[B]

Attributes

Inherited from:
IterableOnceOps
override def toString(): String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
ByteString -> Seq -> Function1 -> Iterable -> Any
Inherited from:
ByteString
Source
ByteString.scala

Attributes

Inherited from:
IterableOnceOps

Attributes

Inherited from:
IterableOps
def unapply(a: Int): Option[Byte]

Attributes

Inherited from:
PartialFunction
override def unzip[A1, A2](implicit asPair: Byte => (A1, A2)): (IndexedSeq[A1], IndexedSeq[A2])

Attributes

Definition Classes
Inherited from:
StrictOptimizedIterableOps
override def unzip3[A1, A2, A3](implicit asTriple: Byte => (A1, A2, A3)): (IndexedSeq[A1], IndexedSeq[A2], IndexedSeq[A3])

Attributes

Definition Classes
Inherited from:
StrictOptimizedIterableOps
override def updated[B >: Byte](index: Int, elem: B): IndexedSeq[B]

Attributes

Definition Classes
Inherited from:
StrictOptimizedSeqOps
final def utf8String: String

Decodes this ByteString as a UTF-8 encoded String.

Decodes this ByteString as a UTF-8 encoded String.

Attributes

Inherited from:
ByteString
Source
ByteString.scala
override def view: IndexedSeqView[Byte]

Attributes

Definition Classes
Inherited from:
IndexedSeqOps

Attributes

Inherited from:
IterableOps
override def zip[B](that: IterableOnce[B]): IndexedSeq[(Byte, B)]

Attributes

Definition Classes
Inherited from:
StrictOptimizedIterableOps
def zipAll[A1 >: Byte, B](that: Iterable[B], thisElem: A1, thatElem: B): IndexedSeq[(A1, B)]

Attributes

Inherited from:
IterableOps
override def zipWithIndex: IndexedSeq[(Byte, Int)]

Attributes

Definition Classes
Inherited from:
StrictOptimizedIterableOps

Deprecated and Inherited methods

final def /:[B](z: B)(op: (B, Byte) => B): B

Attributes

Deprecated
[Since version 2.13.0] Use foldLeft instead of /:
Inherited from:
IterableOnceOps
final def :\[B](z: B)(op: (Byte, B) => B): B

Attributes

Deprecated
[Since version 2.13.0] Use foldRight instead of :\\
Inherited from:
IterableOnceOps
def aggregate[B](z: => B)(seqop: (B, Byte) => B, combop: (B, B) => B): B

Attributes

Deprecated
[Since version 2.13.0] For sequential collections, prefer `foldLeft(z)(seqop)`. For parallel collections, use `ParIterableLike#aggregate`.
Inherited from:
IterableOnceOps

Attributes

Deprecated
[Since version 2.13.0] Use iterableFactory instead
Inherited from:
IterableOps
final def copyToBuffer[B >: Byte](dest: Buffer[B]): Unit

Attributes

Deprecated
[Since version 2.13.0] Use `dest ++= coll` instead
Inherited from:
IterableOnceOps

Attributes

Deprecated
[Since version 2.13.0] Check .knownSize instead of .hasDefiniteSize for more actionable information (see scaladoc for details)
Inherited from:
IterableOnceOps
final def prefixLength(p: Byte => Boolean): Int

Attributes

Deprecated
[Since version 2.13.0] Use segmentLength instead of prefixLength
Inherited from:
SeqOps
final def repr: ByteString

Attributes

Deprecated
[Since version 2.13.0] Use coll instead of repr in a collection implementation, use the collection value itself from the outside
Inherited from:
IterableOps
def reverseMap[B](f: Byte => B): IndexedSeq[B]

Attributes

Deprecated
[Since version 2.13.0] Use .reverseIterator.map(f).to(...) instead of .reverseMap(f)
Inherited from:
SeqOps
def seq: Iterable.this.type

Attributes

Deprecated
[Since version 2.13.0] Iterable.seq always returns the iterable itself
Inherited from:
Iterable
final def toIterable: Iterable.this.type

Attributes

Deprecated
[Since version 2.13.7] toIterable is internal and will be made protected; its name is similar to `toList` or `toSeq`, but it doesn\'t copy non-immutable collections
Inherited from:
Iterable
final def toIterator: Iterator[Byte]

Attributes

Deprecated
[Since version 2.13.0] Use .iterator instead of .toIterator
Inherited from:
IterableOnceOps
final def toStream: Stream[Byte]

Attributes

Deprecated
[Since version 2.13.0] Use .to(LazyList) instead of .toStream
Inherited from:
IterableOnceOps

Attributes

Deprecated
[Since version 2.13.0] toTraversable is internal and will be made protected; its name is similar to `toList` or `toSeq`, but it doesn\'t copy non-immutable collections
Inherited from:
IterableOps
final def union[B >: Byte](that: Seq[B]): IndexedSeq[B]

Attributes

Deprecated
[Since version 2.13.0] Use `concat` instead
Inherited from:
SeqOps
override def view(from: Int, until: Int): IndexedSeqView[Byte]

Attributes

Deprecated
[Since version 2.13.0] Use .view.slice(from, until) instead of .view(from, until)
Definition Classes
Inherited from:
IndexedSeqOps

Concrete fields

val length: Int

Attributes

Source
ByteString.scala

Inherited fields

lazy override val hashCode: Int

Calculates a hash code value for the object.

Calculates a hash code value for the object.

The default hashing algorithm is platform dependent.

Note that it is allowed for two objects to have identical hash codes (o1.hashCode.equals(o2.hashCode)) yet not be equal (o1.equals(o2) returns false). A degenerate implementation could always return 0. However, it is required that if two objects are equal (o1.equals(o2) returns true) that they have identical hash codes (o1.hashCode.equals(o2.hashCode)). Therefore, when overriding this method, be sure to verify that the behavior is consistent with the equals method.

Attributes

Returns

the hash code value for this object.

Inherited from:
ByteString
Source
ByteString.scala