Packages

trait SizedBytes[T] extends Serializable

Type-class for working with a collection of bytes with a specific size.

T

the underlying type of the collection

Annotations
@implicitNotFound()
Linear Supertypes
Ordering
  1. Alphabetic
  2. By Inheritance
Inherited
  1. SizedBytes
  2. Serializable
  3. Any
  1. Hide All
  2. Show All
Visibility
  1. Public
  2. Protected

Abstract Value Members

  1. abstract def fit(from: ByteVector, ordering: ByteOrdering): T

    Fits the given ByteVector into a T with the expected size.

    Fits the given ByteVector into a T with the expected size. Truncates or pads as necessary defined by the ByteOrdering.

    from

    the ByteVector to 'fit' into the expected size

    ordering

    the ordering of the bytes within the ByteVector

    returns

    a T containing the expected number of bytes

  2. abstract def getClass(): Class[_ <: AnyRef]
    Definition Classes
    Any
  3. abstract def size: Int

    The size of the byte vector

  4. abstract def toVector(t: T): ByteVector

    Transforms the value of type T into a ByteVector.

    Transforms the value of type T into a ByteVector.

    t

    the value to transform

    returns

    a ByteVector containing the bytes from collection T

  5. abstract def validated(vector: ByteVector): Either[InvalidSize, T]

    Validates that the given ByteVector is of the expected size.

    Validates that the given ByteVector is of the expected size.

    vector

    the ByteVector to validate and wrap as a SizedByteCollection of type T

    returns

    the validated T if the vector is of the specified size or an InvalidSize error

Concrete Value Members

  1. final def !=(arg0: Any): Boolean
    Definition Classes
    Any
  2. final def ##: Int
    Definition Classes
    Any
  3. final def ==(arg0: Any): Boolean
    Definition Classes
    Any
  4. final def asInstanceOf[T0]: T0
    Definition Classes
    Any
  5. def equals(arg0: Any): Boolean
    Definition Classes
    Any
  6. def fit(from: ByteBuffer): T

    Fits the given ByteBuffer into a T with the expected size.

    Fits the given ByteBuffer into a T with the expected size. Truncates or pads as necessary defined by the ordering of the buffer.

    from

    the ByteBuffer to 'fit' into the expected size

    returns

    a T containing the expected number of bytes

  7. def fit(from: Array[Byte], ordering: ByteOrdering): T

    Fits the given Array[Byte] into a T with the expected size.

    Fits the given Array[Byte] into a T with the expected size. Truncates or pads as necessary defined by the ByteOrdering.

    from

    the Array[Byte] to 'fit' into the expected size

    ordering

    the ordering of the bytes within the ByteVector

    returns

    a T containing the expected number of bytes

  8. def hashCode(): Int
    Definition Classes
    Any
  9. final def isInstanceOf[T0]: Boolean
    Definition Classes
    Any
  10. def toArray(t: T): Array[Byte]

    Transforms the value of type T into a Array[Byte].

    Transforms the value of type T into a Array[Byte].

    t

    the value to transform

    returns

    a Array[Byte] containing the bytes from collection T

  11. def toString(): String
    Definition Classes
    Any
  12. def validated(array: Array[Byte]): Either[InvalidSize, T]

    Validates that the given Array[Byte] is of the expected size.

    Validates that the given Array[Byte] is of the expected size.

    array

    the Array[Byte] to validate and transform into collection T

    returns

    the validated T if the array is of the specified size or an InvalidSize error

Inherited from Serializable

Inherited from Any

Ungrouped