Object/Class

scodec.bits

ByteVector

Related Docs: class ByteVector | package bits

Permalink

object ByteVector extends Serializable

Companion for ByteVector.

Source
ByteVector.scala
Linear Supertypes
Serializable, Serializable, AnyRef, Any
Ordering
  1. Grouped
  2. Alphabetic
  3. By Inheritance
Inherited
  1. ByteVector
  2. Serializable
  3. Serializable
  4. AnyRef
  5. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. All

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 ==(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  4. def apply(bs: GenTraversableOnce[Byte]): ByteVector

    Permalink

    Constructs a ByteVector from a scala.collection source of bytes.

  5. def apply(buffer: ByteBuffer): ByteVector

    Permalink

    Constructs a ByteVector from a ByteBuffer.

    Constructs a ByteVector from a ByteBuffer. The given ByteBuffer is is copied to ensure the resulting ByteVector is immutable. If this is not desired, use ByteVector.view.

  6. def apply(bytes: Array[Byte], offset: Int, length: Int): ByteVector

    Permalink

    Constructs a ByteVector from an Array[Byte], an offset, and a length.

    Constructs a ByteVector from an Array[Byte], an offset, and a length. The given Array[Byte] is copied to ensure the resulting ByteVector is immutable. If this is not desired, use ByteVector.view.

  7. def apply(bytes: Array[Byte]): ByteVector

    Permalink

    Constructs a ByteVector from an Array[Byte].

    Constructs a ByteVector from an Array[Byte]. The given Array[Byte] is copied to ensure the resulting ByteVector is immutable. If this is not desired, use ByteVector.view.

  8. def apply(bytes: Vector[Byte]): ByteVector

    Permalink

    Constructs a ByteVector from a collection of bytes.

  9. def apply[A](bytes: A*)(implicit arg0: Integral[A]): ByteVector

    Permalink

    Constructs a ByteVector from a list of literal bytes.

    Constructs a ByteVector from a list of literal bytes. Only the least significant byte is used of each integral value.

  10. final def asInstanceOf[T0]: T0

    Permalink
    Definition Classes
    Any
  11. def clone(): AnyRef

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  12. def concat(bvs: GenTraversableOnce[ByteVector]): ByteVector

    Permalink

    Concatenates all the given ByteVectors into a single instance.

  13. val empty: ByteVector

    Permalink

    Empty byte vector.

  14. def encodeAscii(str: String): Either[CharacterCodingException, ByteVector]

    Permalink

    Encodes the specified string to a ByteVector using the US-ASCII charset.

  15. def encodeString(str: String)(implicit charset: Charset): Either[CharacterCodingException, ByteVector]

    Permalink

    Encodes the specified string to a ByteVector using the implicitly available Charset.

  16. def encodeUtf8(str: String): Either[CharacterCodingException, ByteVector]

    Permalink

    Encodes the specified string to a ByteVector using the UTF-8 charset.

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

    Permalink
    Definition Classes
    AnyRef
  18. def equals(arg0: Any): Boolean

    Permalink
    Definition Classes
    AnyRef → Any
  19. def fill[A](size: Long)(b: A)(implicit arg0: Integral[A]): ByteVector

    Permalink

    Constructs a ByteVector of the given size, where all bytes have the value b.

  20. def finalize(): Unit

    Permalink
    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  21. def fromBase64(str: String, alphabet: Base64Alphabet = Bases.Alphabets.Base64): Option[ByteVector]

    Permalink

    Constructs a ByteVector from a base 64 string or returns None if the string is not valid base 64.

    Constructs a ByteVector from a base 64 string or returns None if the string is not valid base 64.

    The string may contain whitespace characters.

  22. def fromBase64Descriptive(str: String, alphabet: Base64Alphabet = Bases.Alphabets.Base64): Either[String, ByteVector]

    Permalink

    Constructs a ByteVector from a base 64 string or returns an error message if the string is not valid base 64.

    Constructs a ByteVector from a base 64 string or returns an error message if the string is not valid base 64.

    The string may contain whitespace characters.

  23. def fromBin(str: String, alphabet: BinaryAlphabet = Bases.Alphabets.Binary): Option[ByteVector]

    Permalink

    Constructs a ByteVector from a binary string or returns None if the string is not valid binary.

    Constructs a ByteVector from a binary string or returns None if the string is not valid binary.

    The string may start with a 0b and it may contain whitespace or underscore characters.

  24. def fromBinDescriptive(str: String, alphabet: BinaryAlphabet = Bases.Alphabets.Binary): Either[String, ByteVector]

    Permalink

    Constructs a ByteVector from a binary string or returns an error message if the string is not valid binary.

    Constructs a ByteVector from a binary string or returns an error message if the string is not valid binary.

    The string may start with a 0b and it may contain whitespace or underscore characters.

  25. def fromByte(b: Byte): ByteVector

    Permalink

    Constructs a ByteVector vector with the 2's complement encoding of the specified byte.

    Constructs a ByteVector vector with the 2's complement encoding of the specified byte.

    b

    value to encode

  26. def fromHex(str: String, alphabet: HexAlphabet = Bases.Alphabets.HexLowercase): Option[ByteVector]

    Permalink

    Constructs a ByteVector from a hexadecimal string or returns None if the string is not valid hexadecimal.

    Constructs a ByteVector from a hexadecimal string or returns None if the string is not valid hexadecimal.

    The string may start with a 0x and it may contain whitespace or underscore characters.

  27. def fromHexDescriptive(str: String, alphabet: HexAlphabet = Bases.Alphabets.HexLowercase): Either[String, ByteVector]

    Permalink

    Constructs a ByteVector from a hexadecimal string or returns an error message if the string is not valid hexadecimal.

    Constructs a ByteVector from a hexadecimal string or returns an error message if the string is not valid hexadecimal.

    The string may start with a 0x and it may contain whitespace or underscore characters.

  28. def fromInt(i: Int, size: Int = 4, ordering: ByteOrdering = ByteOrdering.BigEndian): ByteVector

    Permalink

    Constructs a ByteVector with the 2's complement encoding of the specified value.

    Constructs a ByteVector with the 2's complement encoding of the specified value.

    i

    value to encode

    size

    size of vector (<= 4)

    ordering

    byte ordering of vector

  29. def fromLong(l: Long, size: Int = 8, ordering: ByteOrdering = ByteOrdering.BigEndian): ByteVector

    Permalink

    Constructs a ByteVector with the 2's complement encoding of the specified value.

    Constructs a ByteVector with the 2's complement encoding of the specified value.

    l

    value to encode

    size

    size of vector (<= 8)

    ordering

    byte ordering of vector

  30. def fromShort(s: Short, size: Int = 2, ordering: ByteOrdering = ByteOrdering.BigEndian): ByteVector

    Permalink

    Constructs a ByteVector vector with the 2's complement encoding of the specified value.

    Constructs a ByteVector vector with the 2's complement encoding of the specified value.

    s

    value to encode

    size

    size of vector (<= 2)

    ordering

    byte ordering of vector

  31. final def fromUUID(u: UUID): ByteVector

    Permalink

    Constructs a ByteVector containing the binary representation of the specified UUID.

    Constructs a ByteVector containing the binary representation of the specified UUID. The bytes are in MSB-to-LSB order.

    u

    value to encode

  32. def fromValidBase64(str: String, alphabet: Base64Alphabet = Bases.Alphabets.Base64): ByteVector

    Permalink

    Constructs a ByteVector from a base 64 string or throws an IllegalArgumentException if the string is not valid base 64.

    Constructs a ByteVector from a base 64 string or throws an IllegalArgumentException if the string is not valid base 64.

    The string may contain whitespace characters.

    Exceptions thrown

    IllegalArgumentException if the string is not valid base 64

  33. def fromValidBin(str: String, alphabet: BinaryAlphabet = Bases.Alphabets.Binary): ByteVector

    Permalink

    Constructs a ByteVector from a binary string or throws an IllegalArgumentException if the string is not valid binary.

    Constructs a ByteVector from a binary string or throws an IllegalArgumentException if the string is not valid binary.

    The string may start with a 0b and it may contain whitespace or underscore characters.

    Exceptions thrown

    IllegalArgumentException if the string is not valid binary

  34. def fromValidHex(str: String, alphabet: HexAlphabet = Bases.Alphabets.HexLowercase): ByteVector

    Permalink

    Constructs a ByteVector from a hexadecimal string or throws an IllegalArgumentException if the string is not valid hexadecimal.

    Constructs a ByteVector from a hexadecimal string or throws an IllegalArgumentException if the string is not valid hexadecimal.

    The string may start with a 0x and it may contain whitespace or underscore characters.

    Exceptions thrown

    IllegalArgumentException if the string is not valid hexadecimal

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

    Permalink
    Definition Classes
    AnyRef → Any
  36. def hashCode(): Int

    Permalink
    Definition Classes
    AnyRef → Any
  37. def high(size: Long): ByteVector

    Permalink

    Constructs a ByteVector of the given size, where all bytes have the value 0xff.

  38. final def isInstanceOf[T0]: Boolean

    Permalink
    Definition Classes
    Any
  39. def low(size: Long): ByteVector

    Permalink

    Constructs a ByteVector of the given size, where all bytes have the value 0.

  40. final def ne(arg0: AnyRef): Boolean

    Permalink
    Definition Classes
    AnyRef
  41. final def notify(): Unit

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

    Permalink
    Definition Classes
    AnyRef
  43. final def synchronized[T0](arg0: ⇒ T0): T0

    Permalink
    Definition Classes
    AnyRef
  44. def toString(): String

    Permalink
    Definition Classes
    AnyRef → Any
  45. def unapplySeq(b: ByteVector): Some[Seq[Byte]]

    Permalink

    Extractor used in support of pattern matching on the bytes of a vector.

  46. def view(bytes: ByteBuffer): ByteVector

    Permalink

    Constructs a ByteVector from a ByteBuffer.

    Constructs a ByteVector from a ByteBuffer. Unlike apply, this does not make a copy of the input buffer, so callers should take care not to modify the contents of the buffer passed to this function.

  47. def view(bytes: Array[Byte], offset: Int, size: Int): ByteVector

    Permalink

    Constructs a ByteVector from a slice of an Array[Byte].

    Constructs a ByteVector from a slice of an Array[Byte]. Unlike apply, this does not make a copy of the input array, so callers should take care not to modify the contents of the array passed to this function.

  48. def view(bytes: Array[Byte]): ByteVector

    Permalink

    Constructs a ByteVector from an Array[Byte].

    Constructs a ByteVector from an Array[Byte]. Unlike apply, this does not make a copy of the input array, so callers should take care not to modify the contents of the array passed to this function.

  49. def viewAt(at: (Long) ⇒ Byte, size: Long): ByteVector

    Permalink

    Constructs a ByteVector from a function from Int => Byte and a size.

  50. def viewI(at: (Long) ⇒ Int, size: Long): ByteVector

    Permalink

    Constructs a ByteVector from a function from Long => Int and a size, where the Int returned by at must fit in a Byte.

  51. final def wait(): Unit

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

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

    Permalink
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Constants

conversions

Constructors

Numeric Conversions

Base Conversions

Ungrouped