scodec.bits

BitVector

object BitVector

Companion for BitVector.

Linear Supertypes
AnyRef, Any
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. BitVector
  2. AnyRef
  3. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Value Members

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

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def apply[A](bytes: A*)(implicit arg0: Integral[A]): BitVector

  7. def apply(bs: Array[Byte]): BitVector

  8. def apply(buffer: ByteBuffer): BitVector

  9. def apply(bs: ByteVector): BitVector

  10. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  11. def bit(high: Boolean): BitVector

  12. def bits(b: Iterable[Boolean]): BitVector

  13. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  14. val empty: BitVector

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

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

    Definition Classes
    AnyRef → Any
  17. def fill(n: Long)(high: Boolean): BitVector

  18. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  19. def fromBin(str: String): Option[BitVector]

    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.

  20. def fromBinDescriptive(str: String): Either[String, BitVector]

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

    Constructs a BitVector 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.

  21. def fromChannel(in: ReadableByteChannel, chunkSizeInBytes: Int = 4096 * 2, direct: Boolean = false): BitVector

    Produce a lazy BitVector from the given ReadableByteChannel, using chunkSizeInBytes to control the number of bytes read in each chunk (defaulting to 8k).

    Produce a lazy BitVector from the given ReadableByteChannel, using chunkSizeInBytes to control the number of bytes read in each chunk (defaulting to 8k). This function does lazy I/O, see scodec.BitVector.fromInputStream for caveats. The direct parameter, if true, allows for (but does not enforce) using a 'direct' java.nio.ByteBuffer for each chunk, which means the buffer and corresponding BitVector chunk may be backed by a 'view' rather than an in-memory array. This may be more efficient for some workloads. See java.nio.ByteBuffer for more information.

    chunkSizeInBytes

    the number of bytes to read in each chunk

    direct

    true if we should attempt to use a 'direct' java.nio.ByteBuffer for reads

  22. def fromHex(str: String): Option[BitVector]

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

    Constructs a BitVector 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.

  23. def fromHexDescriptive(str: String): Either[String, BitVector]

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

    Constructs a BitVector 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.

  24. def fromInputStream(in: InputStream, chunkSizeInBytes: Int = 4096 * 2): BitVector

    Produce a lazy BitVector from the given InputStream, using chunkSizeInBytes to control the number of bytes read in each chunk (defaulting to 4MB).

    Produce a lazy BitVector from the given InputStream, using chunkSizeInBytes to control the number of bytes read in each chunk (defaulting to 4MB). This simply calls scodec.BitVector.unfold with a function to extract a series of flat byte arrays from the InputStream.

    This function does not handle closing the InputStream and has all the usual drawbacks of lazy I/O - I/O exceptions may be raised unexpectedly in pure code as chunks are forced, and it must memoize the results to prevent the underlying side effects from being observed. Streaming applications should take care to ensure that the head of the stream is not left on the stack, as this will cause the entire stream to be retained in memory.

    chunkSizeInBytes

    the number of bytes to read in each chunk

  25. def fromMmap(in: FileChannel, chunkSizeInBytes: Int = 1024 * 1000 * 16): BitVector

    Produce a lazy BitVector from the given FileChannel, using chunkSizeInBytes to control the number of bytes read in each chunk (defaulting to 16MB).

    Produce a lazy BitVector from the given FileChannel, using chunkSizeInBytes to control the number of bytes read in each chunk (defaulting to 16MB). Unlike scodec.BitVector.fromChannel, this memory-maps chunks in, rather than copying them explicitly.

    Behavior is unspecified if this function is used concurrently with the underlying file being written.

    chunkSizeInBytes

    the number of bytes to read in each chunk

  26. def fromValidBin(str: String): BitVector

    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 hexadecimal

  27. def fromValidHex(str: String): BitVector

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

    Constructs a BitVector 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

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

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

    Definition Classes
    AnyRef → Any
  30. def high(n: Long): BitVector

  31. val highByte: BitVector

  32. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  33. def low(n: Long): BitVector

  34. val lowByte: BitVector

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

    Definition Classes
    AnyRef
  36. final def notify(): Unit

    Definition Classes
    AnyRef
  37. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  38. val one: BitVector

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

    Definition Classes
    AnyRef
  40. def toString(): String

    Definition Classes
    AnyRef → Any
  41. def unfold[S](s: S)(f: (S) ⇒ Option[(BitVector, S)]): BitVector

    Create a lazy BitVector by repeatedly extracting chunks from S.

    Create a lazy BitVector by repeatedly extracting chunks from S. The returned BitVector will have the structure of a fully lazy right-associated cons list. Thus, get, take, and drop will be efficient when operating on the head of the list, but accessing later indices (for takeRight, say, or get(size-1) will require forcing the stream up to that point.

    Use force if you wish to convert the result to an in-memory strict BitVector backed by a balanced tree.

  42. def view(bs: Array[Byte]): BitVector

    Like apply, but no copy of the underlying array is made.

  43. def view(buffer: ByteBuffer, sizeInBits: Long): BitVector

    Like apply, but no copy of the underlying ByteBuffer is made.

  44. def view(buffer: ByteBuffer): BitVector

    Like apply, but no copy of the underlying ByteBuffer is made.

    Like apply, but no copy of the underlying ByteBuffer is made. Uses buffer.limit to compute the size.

  45. final def wait(): Unit

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

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

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  48. val zero: BitVector

Inherited from AnyRef

Inherited from Any

Ungrouped