Class/Object

scodec.bits

ByteVector

Related Docs: object ByteVector | package bits

Permalink

sealed abstract class ByteVector extends ByteVectorCrossPlatform with BitwiseOperations[ByteVector, Long] with Ordered[ByteVector] with Serializable

An immutable vector of bytes, backed by a balanced binary tree of chunks. Most operations are logarithmic in the depth of this tree, including ++, :+, +:, update, and insert. Where possible, operations return lazy views rather than copying any underlying bytes. Use copy to copy all underlying bytes to a fresh, array-backed ByteVector.

Unless otherwise noted, operations follow the same naming as the scala standard library collections, though this class does not extend any of the standard scala collections. Use toIndexedSeq, toSeq, or toIterable to obtain a regular scala.collection type.

Source
ByteVector.scala
Linear Supertypes
Serializable, Serializable, Ordered[ByteVector], Comparable[ByteVector], BitwiseOperations[ByteVector, Long], ByteVectorCrossPlatform, AnyRef, Any
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. ByteVector
  2. Serializable
  3. Serializable
  4. Ordered
  5. Comparable
  6. BitwiseOperations
  7. ByteVectorCrossPlatform
  8. AnyRef
  9. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

Abstract Value Members

  1. abstract def getImpl(index: Long): Byte

    Permalink
    Attributes
    protected
  2. abstract def size: Long

    Permalink

    Returns the number of bytes in this vector.

Concrete Value Members

  1. final def !=(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  2. final def ##(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  3. final def &(other: ByteVector): ByteVector

    Permalink

    Returns a bitwise AND of this value with the specified

    Returns a bitwise AND of this value with the specified

    value.

    The resulting value's size is the minimum of this

    value's size and the specified value's size.

    Definition Classes
    BitwiseOperations
  4. def ++(other: ByteVector): ByteVector

    Permalink

    Returns a new byte vector representing this vector's contents followed by the specified vector's contents.

  5. final def +:(byte: Byte): ByteVector

    Permalink

    Returns a new vector with the specified byte prepended.

  6. def :+(byte: Byte): ByteVector

    Permalink

    Returns a new vector with the specified byte appended.

  7. def <(that: ByteVector): Boolean

    Permalink
    Definition Classes
    Ordered
  8. final def <<(n: Long): ByteVector

    Permalink

    Returns a value of the same size with each bit shifted to the left n bits.

    Returns a value of the same size with each bit shifted to the left n bits.

    Definition Classes
    BitwiseOperations
  9. def <=(that: ByteVector): Boolean

    Permalink
    Definition Classes
    Ordered
  10. final def ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  11. final def ===(other: ByteVector): Boolean

    Permalink

    Returns true if the specified ByteVector has the same contents as this vector.

  12. def >(that: ByteVector): Boolean

    Permalink
    Definition Classes
    Ordered
  13. def >=(that: ByteVector): Boolean

    Permalink
    Definition Classes
    Ordered
  14. final def >>(n: Long): ByteVector

    Permalink

    Returns a value of the same size with each bit shifted to the right n bits where the n left-most bits are sign extended.

    Returns a value of the same size with each bit shifted to the right n bits where the n left-most bits are sign extended.

    Definition Classes
    BitwiseOperations
  15. final def >>>(n: Long): ByteVector

    Permalink

    Returns a value of the same size with each bit shifted to the right n bits where the n left-most bits are low.

    Returns a value of the same size with each bit shifted to the right n bits where the n left-most bits are low.

    Definition Classes
    BitwiseOperations
  16. final def ^(other: ByteVector): ByteVector

    Permalink

    Returns a bitwise XOR of this value with the specified

    Returns a bitwise XOR of this value with the specified

    value.

    The resulting value's size is the minimum of this

    value's size and the specified value's size.

    Definition Classes
    BitwiseOperations
  17. def acquire(n: Long): Either[String, ByteVector]

    Permalink

    Returns a vector whose contents are the results of taking the first n bytes of this vector.

    Returns a vector whose contents are the results of taking the first n bytes of this vector.

    If this vector does not contain at least n bytes, an error message is returned.

    See also

    take

  18. final def and(other: ByteVector): ByteVector

    Permalink

    Returns a bitwise AND of this bit vector with the specified

    Returns a bitwise AND of this bit vector with the specified

    bit vector.

    The resulting bit vector's size is the minimum of this

    bit vector's size and the specified bit vector's size.

    Definition Classes
    ByteVectorBitwiseOperations
  19. final def apply(index: Long): Byte

    Permalink

    Alias for get.

    Alias for get.

    Exceptions thrown

    IndexOutOfBoundsException if the specified index is not in [0, size)

  20. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  21. final def bits: BitVector

    Permalink

    Alias for toBitVector.

  22. final def buffer: ByteVector

    Permalink

    Allocate (unobservable) mutable scratch space at the end of this ByteVector, which will be used to support fast :+ and ++ of small vectors.

    Allocate (unobservable) mutable scratch space at the end of this ByteVector, which will be used to support fast :+ and ++ of small vectors. A default chunk size is used.

    Note that :+, ++, and drop on the result of a call to buffer are guaranteed to return another buffered ByteVector.

  23. final def bufferBy(chunkSize: Int): ByteVector

    Permalink

    Allocate (unobservable) mutable scratch space at the end of this ByteVector, with chunks of the given size, which will be used to support fast :+ and ++ of small vectors.

    Allocate (unobservable) mutable scratch space at the end of this ByteVector, with chunks of the given size, which will be used to support fast :+ and ++ of small vectors.

    Note that :+, ++, and drop on the result of a call to buffer are guaranteed to return another buffered ByteVector, with the same size scratch space.

  24. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  25. final def compact: ByteVector

    Permalink

    Returns a vector with the same contents but represented as a single tree node internally.

    Returns a vector with the same contents but represented as a single tree node internally.

    This may involve copying data, but has the advantage that lookups index directly into a single node rather than traversing a logarithmic number of nodes in this tree.

    Calling this method on an already compacted vector is a no-op.

  26. def compare(that: ByteVector): Int

    Permalink
    Definition Classes
    ByteVector → Ordered
  27. def compareTo(that: ByteVector): Int

    Permalink
    Definition Classes
    Ordered → Comparable
  28. final def consume[A](n: Long)(decode: (ByteVector) ⇒ Either[String, A]): Either[String, (ByteVector, A)]

    Permalink

    Consumes the first n bytes of this vector and decodes them with the specified function, resulting in a vector of the remaining bytes and the decoded value.

    Consumes the first n bytes of this vector and decodes them with the specified function, resulting in a vector of the remaining bytes and the decoded value. If this vector does not have n bytes or an error occurs while decoding, an error is returned instead.

  29. final def containsSlice(slice: ByteVector): Boolean

    Permalink

    Determines if the specified slice is in this vector.

  30. final def copy: ByteVector

    Permalink

    Returns a vector with the same contents as this vector but with a single compacted node made up by evaluating all internal nodes and concatenating their values.

  31. final def copyToArray(xs: Array[Byte], start: Int, offset: Long, size: Int): Unit

    Permalink

    Copies size bytes of this vector, starting at index offset, to array xs, beginning at index start.

  32. final def copyToArray(xs: Array[Byte], start: Int): Unit

    Permalink

    Copies the contents of this vector to array xs, beginning at index start.

  33. final def copyToBuffer(buffer: ByteBuffer): Int

    Permalink

    Copies as many bytes as possible to the given ByteBuffer, starting from its current position.

    Copies as many bytes as possible to the given ByteBuffer, starting from its current position. This method will not overflow the buffer.

    buffer

    a ByteBuffer to copy bytes to

    returns

    the number of bytes actually copied

  34. def copyToJSArrayBuffer(dest: ArrayBuffer, start: Int, offset: Long, size: Int): Unit

    Permalink
    Definition Classes
    ByteVectorCrossPlatform
  35. def copyToJSArrayBuffer(dest: ArrayBuffer, start: Int): Unit

    Permalink
    Definition Classes
    ByteVectorCrossPlatform
  36. final def copyToStream(s: OutputStream): Unit

    Permalink

    Copies the contents of this vector to OutputStream s.

  37. def copyToUint8Array(dest: Uint8Array, start: Int, offset: Long, size: Int): Unit

    Permalink
    Definition Classes
    ByteVectorCrossPlatform
  38. def copyToUint8Array(dest: Uint8Array, start: Int): Unit

    Permalink
    Definition Classes
    ByteVectorCrossPlatform
  39. final def decodeAscii: Either[CharacterCodingException, String]

    Permalink

    Decodes this vector as a string using the US-ASCII charset.

  40. final def decodeAsciiLenient: String

    Permalink

    Like decodeAscii but does not fail on bad input.

  41. final def decodeString(implicit charset: Charset): Either[CharacterCodingException, String]

    Permalink

    Decodes this vector as a string using the implicitly available charset.

  42. final def decodeStringLenient(replaceMalformedInput: Boolean = true, replaceUnmappableChars: Boolean = true, replacement: String = "�")(implicit charset: Charset): String

    Permalink

    Like decodeString but does not fail on bad input.

  43. final def decodeUtf8: Either[CharacterCodingException, String]

    Permalink

    Decodes this vector as a string using the UTF-8 charset.

  44. final def decodeUtf8Lenient: String

    Permalink

    Like decodeUtf8 but does not fail on bad input.

  45. def drop(n: Long): ByteVector

    Permalink

    Returns a vector of all bytes in this vector except the first n bytes.

    Returns a vector of all bytes in this vector except the first n bytes.

    The resulting vector's size is 0 max (size - n).

  46. final def dropRight(n: Long): ByteVector

    Permalink

    Returns a vector of all bytes in this vector except the last n bytes.

    Returns a vector of all bytes in this vector except the last n bytes.

    The resulting vector's size is 0 max (size - n).

  47. final def dropWhile(f: (Byte) ⇒ Boolean): ByteVector

    Permalink

    Drops the longest prefix of this vector such that every byte of the prefix satisfies the specific predicate.

  48. final def endsWith(b: ByteVector): Boolean

    Permalink

    Returns true if this byte vector ends with the specified vector.

  49. final def eq(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  50. def equals(other: Any): Boolean

    Permalink

    Returns true if the specified value is a ByteVector with the same contents as this vector.

    Returns true if the specified value is a ByteVector with the same contents as this vector.

    Definition Classes
    ByteVector → AnyRef → Any
    See also

    ByteVector.===

  51. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  52. final def foldLeft[A](z: A)(f: (A, Byte) ⇒ A): A

    Permalink

    Applies a binary operator to a start value and all elements of this vector, going left to right.

    Applies a binary operator to a start value and all elements of this vector, going left to right.

    z

    starting value

    f

    operator to apply

  53. final def foldLeftBB[A](z: A)(f: (A, ByteBuffer) ⇒ A): A

    Permalink

    Applies a binary operator to a start value and all segments(views) of this ByteVector expressed as read-only ByteBuffer, going left to right.

    Applies a binary operator to a start value and all segments(views) of this ByteVector expressed as read-only ByteBuffer, going left to right.

    z

    Starting value

    f

    operator to apply

  54. final def foldRight[A](z: A)(f: (Byte, A) ⇒ A): A

    Permalink

    Applies a binary operator to a start value and all elements of this vector, going right to left.

    Applies a binary operator to a start value and all elements of this vector, going right to left.

    z

    starting value

    f

    operator to apply

  55. final def foldRightBB[A](z: A)(f: (ByteBuffer, A) ⇒ A): A

    Permalink

    Applies a binary operator to a start value and all segments(views) of this ByteVector expressed as read-only ByteBuffer, going right ot left.

    Applies a binary operator to a start value and all segments(views) of this ByteVector expressed as read-only ByteBuffer, going right ot left.

    z

    Starting value

    f

    operator to apply

  56. final def foreach(f: (Byte) ⇒ Unit): Unit

    Permalink

    Applies the specified function to each element of this vector.

  57. def get(index: Long): Byte

    Permalink

    Gets the byte at the specified index.

    Gets the byte at the specified index.

    Exceptions thrown

    IndexOutOfBoundsException if the specified index is not in [0, size)

  58. final def getClass(): Class[_]

    Permalink
    Definition Classes
    AnyRef → Any
  59. lazy val hashCode: Int

    Permalink

    Calculates the hash code of this vector.

    Calculates the hash code of this vector. The result is cached.

    Definition Classes
    ByteVector → AnyRef → Any
  60. final def head: Byte

    Permalink

    Returns the first byte of this vector or throws if vector is emtpy.

  61. final def headOption: Option[Byte]

    Permalink

    Returns the first byte of this vector or None if vector is emtpy.

  62. def iff(other: ByteVector): ByteVector

    Permalink

    Returns a bitwise if-and-only-if of this value with the specified

    Returns a bitwise if-and-only-if of this value with the specified

    value.

    The resulting value's size is the minimum of this

    value's size and the specified value's size.

    Definition Classes
    BitwiseOperations
  63. def implies(other: ByteVector): ByteVector

    Permalink

    Returns a bitwise implication of this value with the specified

    Returns a bitwise implication of this value with the specified

    value.

    The resulting value's size is the minimum of this

    value's size and the specified value's size.

    Definition Classes
    BitwiseOperations
  64. final def indexOfSlice(slice: ByteVector, from: Long): Long

    Permalink

    Finds the first index after from of the specified byte pattern in this vector.

    Finds the first index after from of the specified byte pattern in this vector.

    returns

    index of slice or -1 if not found

  65. final def indexOfSlice(slice: ByteVector): Long

    Permalink

    Finds the first index of the specified byte pattern in this vector.

    Finds the first index of the specified byte pattern in this vector.

    returns

    index of slice or -1 if not found

  66. final def init: ByteVector

    Permalink

    Returns a vector of all bytes in this vector except the last byte.

  67. final def insert(idx: Long, b: Byte): ByteVector

    Permalink

    Returns a vector with the specified byte inserted at the specified index.

  68. final def intSize: Option[Int]

    Permalink

    Returns the number of bytes in this vector, or None if the size does not fit into an Int.

  69. final def isEmpty: Boolean

    Permalink

    Returns true if this vector has no bytes.

  70. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  71. final def last: Byte

    Permalink

    Returns the last byte in this vector or throws if vector is empty.

  72. final def lastOption: Option[Byte]

    Permalink

    Returns the last byte in this vector or returns None if vector is empty.

  73. final def length: Long

    Permalink

    Alias for size.

  74. final def lift(index: Long): Option[Byte]

    Permalink

    Returns the byte at the specified index, or None if the index is out of range.

  75. final def map(f: (Byte) ⇒ Byte): ByteVector

    Permalink

    Returns a vector where each byte is the result of applying the specified function to the corresponding byte in this vector.

    Returns a vector where each byte is the result of applying the specified function to the corresponding byte in this vector. This method returns a view and hence, is O(1). Call compact to generate a new strict vector.

  76. final def mapI(f: (Byte) ⇒ Int): ByteVector

    Permalink

    Returns a vector where each byte is the result of applying the specified function to the corresponding byte in this vector.

    Returns a vector where each byte is the result of applying the specified function to the corresponding byte in this vector. Only the least significant byte is used (the three most significant bytes are ignored). This method returns a view and hence, is O(1). Call compact to generate a new strict vector.

  77. def nand(other: ByteVector): ByteVector

    Permalink

    Returns a bitwise NAND of this value with the specified

    Returns a bitwise NAND of this value with the specified

    value.

    The resulting value's size is the minimum of this

    value's size and the specified value's size.

    Definition Classes
    BitwiseOperations
  78. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  79. final def nonEmpty: Boolean

    Permalink

    Returns true if this vector has a non-zero number of bytes.

  80. def nor(other: ByteVector): ByteVector

    Permalink

    Returns a bitwise NOR of this value with the specified

    Returns a bitwise NOR of this value with the specified

    value.

    The resulting value's size is the minimum of this

    value's size and the specified value's size.

    Definition Classes
    BitwiseOperations
  81. final def not: ByteVector

    Permalink

    Returns a bitwise complement of this bit vector.

    Returns a bitwise complement of this bit vector.

    Definition Classes
    ByteVectorBitwiseOperations
  82. final def notify(): Unit

    Permalink
    Definition Classes
    AnyRef
  83. final def notifyAll(): Unit

    Permalink
    Definition Classes
    AnyRef
  84. final def or(other: ByteVector): ByteVector

    Permalink

    Returns a bitwise OR of this bit vector with the specified

    Returns a bitwise OR of this bit vector with the specified

    bit vector.

    The resulting bit vector's size is the minimum of this

    bit vector's size and the specified bit vector's size.

    Definition Classes
    ByteVectorBitwiseOperations
  85. final def padLeft(n: Long): ByteVector

    Permalink

    Returns an n-bytes vector whose contents are 0 or more zero bytes followed by this vector's contents.

    Returns an n-bytes vector whose contents are 0 or more zero bytes followed by this vector's contents.

    Exceptions thrown

    IllegalArgumentException if n < size

  86. final def padRight(n: Long): ByteVector

    Permalink

    Returns an n-byte vector whose contents are this vector's contents followed by 0 or more zero bytes.

    Returns an n-byte vector whose contents are this vector's contents followed by 0 or more zero bytes.

    Exceptions thrown

    IllegalArgumentException if n < size

  87. final def padTo(n: Long): ByteVector

    Permalink

    Alias for padRight.

    Alias for padRight.

    Exceptions thrown

    IllegalArgumentException if n < size

  88. final def partialCompact(chunkSize: Long): ByteVector

    Permalink

    Invokes compact on any subtrees whose size is <= chunkSize.

  89. final def patch(idx: Long, b: ByteVector): ByteVector

    Permalink

    Returns a vector with the specified byte vector replacing bytes [idx, idx + b.size].

  90. final def printHexDump(): Unit

    Permalink

    Prints this vector as a colorized hex dump to standard out.

  91. final def reverse: ByteVector

    Permalink

    Returns a vector with the bytes of this vector in reverse order.

    Returns a vector with the bytes of this vector in reverse order. This method returns a view and hence, is O(1). Call compact to generate a new strict vector.

  92. final def rotateLeft(n: Long): ByteVector

    Permalink

    Returns a bit vector of the same size with each bit circularly shifted to the left n bits.

    Returns a bit vector of the same size with each bit circularly shifted to the left n bits.

    Definition Classes
    ByteVectorBitwiseOperations
  93. final def rotateRight(n: Long): ByteVector

    Permalink

    Returns a bit vector of the same size with each bit circularly shifted to the right n bits.

    Returns a bit vector of the same size with each bit circularly shifted to the right n bits.

    Definition Classes
    ByteVectorBitwiseOperations
  94. final def shiftLeft(n: Long): ByteVector

    Permalink

    Returns a bit vector of the same size with each bit shifted to the left n bits.

    Returns a bit vector of the same size with each bit shifted to the left n bits.

    Definition Classes
    ByteVectorBitwiseOperations
  95. final def shiftRight(n: Long, signExtension: Boolean): ByteVector

    Permalink

    Returns a bit vector of the same size with each bit shifted to the right n bits.

    Returns a bit vector of the same size with each bit shifted to the right n bits.

    signExtension

    whether the n left-msot bits should take on the value of bit 0

    Definition Classes
    ByteVectorBitwiseOperations
  96. final def slice(from: Long, until: Long): ByteVector

    Permalink

    Returns a vector made up of the bytes starting at index from up to index until.

  97. final def splice(idx: Long, b: ByteVector): ByteVector

    Permalink

    Returns a vector with the specified byte vector inserted at the specified index.

  98. final def splitAt(n: Long): (ByteVector, ByteVector)

    Permalink

    Returns a pair of vectors that is equal to (take(n), drop(n)).

  99. final def startsWith(b: ByteVector): Boolean

    Permalink

    Returns true if this byte vector starts with the specified vector.

  100. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  101. final def tail: ByteVector

    Permalink

    Returns a vector of all bytes in this vector except the first byte.

  102. def take(n: Long): ByteVector

    Permalink

    Returns a vector of the first n bytes of this vector.

    Returns a vector of the first n bytes of this vector.

    The resulting vector's size is n min size.

    Note: if an n-byte vector is required, use the acquire method instead.

    See also

    acquire

  103. final def takeRight(n: Long): ByteVector

    Permalink

    Returns a vector of the last n bytes of this vector.

    Returns a vector of the last n bytes of this vector.

    The resulting vector's size is n min size.

  104. final def takeWhile(f: (Byte) ⇒ Boolean): ByteVector

    Permalink

    Returns the longest prefix of this vector such that every byte satisfies the specific predicate.

  105. final def toArray: Array[Byte]

    Permalink

    Converts the contents of this vector to a byte array.

  106. final def toBase16(alphabet: HexAlphabet): String

    Permalink

    Helper alias for toHex(alphabet:scodec\.bits\.Bases\.HexAlphabet):String*

  107. final def toBase16: String

    Permalink

    Helper alias for toHex:String*

  108. final def toBase32(alphabet: Base32Alphabet): String

    Permalink

    Converts the contents of this vector to a base 32 string using the specified alphabet.

  109. final def toBase32: String

    Permalink

    Converts the contents of this vector to a base 32 string.

  110. final def toBase58(alphabet: Alphabet): String

    Permalink

    Converts the contents of this vector to a base 58 string using the specified alphabet.

  111. final def toBase58: String

    Permalink

    Converts the contents of this vector to a base 58 string.

  112. final def toBase64(alphabet: Base64Alphabet): String

    Permalink

    Converts the contents of this vector to a base 64 string using the specified alphabet.

  113. final def toBase64: String

    Permalink

    Converts the contents of this vector to a base 64 string.

  114. final def toBase64NoPad: String

    Permalink

    Converts the contents of this vector to a base 64 string without padding.

  115. final def toBase64Url: String

    Permalink

    Converts the contents of this vector to a base 64 url string with padding.

  116. final def toBase64UrlNoPad: String

    Permalink

    Converts the contents of this vector to a base 64 url string without padding.

  117. final def toBin(alphabet: BinaryAlphabet): String

    Permalink

    Converts the contents of this byte vector to a binary string of size * 8 digits.

  118. final def toBin: String

    Permalink

    Converts the contents of this byte vector to a binary string of size * 8 digits.

  119. final def toBitVector: BitVector

    Permalink

    Converts the contents of this vector to a bit vector of size * 8 bits.

  120. final def toByte(signed: Boolean = true): Byte

    Permalink

    Converts the contents of this vector to a byte.

    Converts the contents of this vector to a byte.

    signed

    whether sign extension should be performed

    Exceptions thrown

    IllegalArgumentException if size is greater than 8

  121. final def toByteBuffer: ByteBuffer

    Permalink

    Represents the contents of this vector as a read-only java.nio.ByteBuffer.

    Represents the contents of this vector as a read-only java.nio.ByteBuffer.

    The returned buffer is read-only with limit set to the minimum number of bytes needed to represent the contents of this vector, position set to zero, and remaining set to the limit.

  122. final def toHex(alphabet: HexAlphabet): String

    Permalink

    Converts the contents of this byte vector to a hexadecimal string of size * 2 nibbles.

  123. final def toHex: String

    Permalink

    Converts the contents of this byte vector to a hexadecimal string of size * 2 nibbles.

  124. final def toHexDump: String

    Permalink

    Generates a hex dump of this vector using the default format (with no color / ANSI escapes).

    Generates a hex dump of this vector using the default format (with no color / ANSI escapes). To customize the output, use the HexDumpFormat class instead. For example, HexDumpFormat.NoAscii.render(bytes) or HexDumpFormat.Default.withIncludeAddressColumn(false).render(bytes).

  125. final def toHexDumpColorized: String

    Permalink

    Colorized version of toHexDump that uses ANSI escape codes.

  126. final def toIndexedSeq: IndexedSeq[Byte]

    Permalink

    Converts the contents of this vector to an IndexedSeq.

  127. final def toInputStream: InputStream

    Permalink

    Creates new InputStream reading data from this ByteVector.

  128. final def toInt(signed: Boolean = true, ordering: ByteOrdering = ByteOrdering.BigEndian): Int

    Permalink

    Converts the contents of this vector to an int.

    Converts the contents of this vector to an int.

    signed

    whether sign extension should be performed

    ordering

    order bytes should be processed in

    Exceptions thrown

    IllegalArgumentException if size is greater than 32

  129. final def toIterable: Iterable[Byte]

    Permalink

    Converts the contents of this vector to an Iterable.

  130. def toJSArrayBuffer: ArrayBuffer

    Permalink
    Definition Classes
    ByteVectorCrossPlatform
  131. final def toLong(signed: Boolean = true, ordering: ByteOrdering = ByteOrdering.BigEndian): Long

    Permalink

    Converts the contents of this vector to an int.

    Converts the contents of this vector to an int.

    signed

    whether sign extension should be performed

    ordering

    order bytes should be processed in

    Exceptions thrown

    IllegalArgumentException if size is greater than 64

  132. final def toSeq: Seq[Byte]

    Permalink

    Converts the contents of this vector to a Seq.

  133. final def toShort(signed: Boolean = true, ordering: ByteOrdering = ByteOrdering.BigEndian): Short

    Permalink

    Converts the contents of this vector to a short.

    Converts the contents of this vector to a short.

    signed

    whether sign extension should be performed

    ordering

    order bytes should be processed in

    Exceptions thrown

    IllegalArgumentException if size is greater than 16

  134. def toString(): String

    Permalink

    Display the size and bytes of this ByteVector.

    Display the size and bytes of this ByteVector. For bit vectors beyond a certain size, only a hash of the contents are shown.

    Definition Classes
    ByteVector → AnyRef → Any
  135. final def toUUID: UUID

    Permalink

    Converts the contents of this byte vector to a UUID.

    Converts the contents of this byte vector to a UUID.

    Exceptions thrown

    IllegalArgumentException if size is not exactly 16.

  136. def toUint8Array: Uint8Array

    Permalink
    Definition Classes
    ByteVectorCrossPlatform
  137. final def unary_~: ByteVector

    Permalink

    Returns a bitwise complement of this value.

    Returns a bitwise complement of this value.

    Definition Classes
    BitwiseOperations
  138. def unbuffer: ByteVector

    Permalink

    Collapse any buffered chunks at the end of this ByteVector, resulting in an unbuffered ByteVector.

  139. final def update(idx: Long, b: Byte): ByteVector

    Permalink

    Returns a vector with the byte at the specified index replaced with the specified byte.

  140. final def wait(): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  141. final def wait(arg0: Long, arg1: Int): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  142. final def wait(arg0: Long): Unit

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  143. final def writeReplace(): AnyRef

    Permalink
    Attributes
    protected
  144. final def xor(other: ByteVector): ByteVector

    Permalink

    Returns a bitwise XOR of this bit vector with the specified

    Returns a bitwise XOR of this bit vector with the specified

    bit vector.

    The resulting bit vector's size is the minimum of this

    bit vector's size and the specified bit vector's size.

    Definition Classes
    ByteVectorBitwiseOperations
  145. final def zipWith(other: ByteVector)(f: (Byte, Byte) ⇒ Byte): ByteVector

    Permalink

    Returns a new vector where each byte is the result of evaluating the specified function against the bytes of this vector and the specified vector at the corresponding index.

    Returns a new vector where each byte is the result of evaluating the specified function against the bytes of this vector and the specified vector at the corresponding index. The resulting vector has size this.size min other.size. This method returns a view and hence, is O(1). Call compact to generate a new strict vector.

  146. final def zipWith2(other: ByteVector, other2: ByteVector)(f: (Byte, Byte, Byte) ⇒ Byte): ByteVector

    Permalink

    See zipWith This method returns a view and hence, is O(1).

    See zipWith This method returns a view and hence, is O(1). Call compact to generate a new strict vector.

  147. final def zipWith3(other: ByteVector, other2: ByteVector, other3: ByteVector)(f: (Byte, Byte, Byte, Byte) ⇒ Byte): ByteVector

    Permalink

    See zipWith This method returns a view and hence, is O(1).

    See zipWith This method returns a view and hence, is O(1). Call compact to generate a new strict vector.

  148. final def zipWithI(other: ByteVector)(op: (Byte, Byte) ⇒ Int): ByteVector

    Permalink

    Returns a new vector where each byte is the result of evaluating the specified function against the bytes of this vector and the specified vector at the corresponding index.

    Returns a new vector where each byte is the result of evaluating the specified function against the bytes of this vector and the specified vector at the corresponding index. The resulting vector has size this.size min other.size. Only the least significant byte is used (the three most significant bytes are ignored). This method returns a view and hence, is O(1). Call compact to generate a new strict vector.

  149. final def zipWithI2(other: ByteVector, other2: ByteVector)(op: (Byte, Byte, Byte) ⇒ Int): ByteVector

    Permalink

    See zipWithI This method returns a view and hence, is O(1).

    See zipWithI This method returns a view and hence, is O(1). Call compact to generate a new strict vector.

  150. final def zipWithI3(other: ByteVector, other2: ByteVector, other3: ByteVector)(op: (Byte, Byte, Byte, Byte) ⇒ Int): ByteVector

    Permalink

    See zipWithI This method returns a view and hence, is O(1).

    See zipWithI This method returns a view and hence, is O(1). Call compact to generate a new strict vector.

  151. final def |(other: ByteVector): ByteVector

    Permalink

    Returns a bitwise OR of this value with the specified

    Returns a bitwise OR of this value with the specified

    value.

    The resulting value's size is the minimum of this

    value's size and the specified value's size.

    Definition Classes
    BitwiseOperations

Inherited from Serializable

Inherited from Serializable

Inherited from Ordered[ByteVector]

Inherited from Comparable[ByteVector]

Inherited from BitwiseOperations[ByteVector, Long]

Inherited from ByteVectorCrossPlatform

Inherited from AnyRef

Inherited from Any

Collection Like Methods

Bitwise Operations

Conversions

Buffering

Ungrouped