ByteAccess

trait ByteAccess[Bytes]

Type class for providing basic access to a Bytes abstraction, as well as construction of a respective Output.

Companion:
object
class Object
trait Matchable
class Any
object ForByteArray.type
object ForByteBuffer.type

Type members

Types

type Out <: Output

Value members

Abstract methods

def concat(a: Bytes, b: Bytes): Bytes

Returns the concatenation of a and b.

Returns the concatenation of a and b.

def convert[B : ByteAccess](value: B): Bytes

Converts the given value of type B into a Bytes instance.

Converts the given value of type B into a Bytes instance.

def copyToByteArray(bytes: Bytes, byteArray: Array[Byte], startIndex: Int): Bytes

Copies the given Bytes instance into the given byteArray starting at the given index. Returns a Bytes instance holding all bytes that could not be written to the byte array due to capacity constraints or an empty Bytes instance, if the given byte array was large enough to hold all bytes.

Copies the given Bytes instance into the given byteArray starting at the given index. Returns a Bytes instance holding all bytes that could not be written to the byte array due to capacity constraints or an empty Bytes instance, if the given byte array was large enough to hold all bytes.

def copyToByteBuffer(bytes: Bytes, byteBuffer: ByteBuffer): Bytes

Copies the given Bytes instance into the given byteBuffer. Returns a Bytes instance holding all bytes that could not be written to the byteBuffer due to capacity constraints or an empty Bytes instance, if the given byteBuffer was large enough to hold all bytes.

Copies the given Bytes instance into the given byteBuffer. Returns a Bytes instance holding all bytes that could not be written to the byteBuffer due to capacity constraints or an empty Bytes instance, if the given byteBuffer was large enough to hold all bytes.

def empty: Bytes

Returns an empty Bytes instance.

Returns an empty Bytes instance.

def fromByteArray(byteArray: Array[Byte]): Bytes

Converts the given byte array into a Bytes instance.

Converts the given byte array into a Bytes instance.

def isEmpty(bytes: Bytes): Boolean

Returns true iff the given Bytes instance is empty.

Returns true iff the given Bytes instance is empty.

def sizeOf(bytes: Bytes): Long

Returns the number of bytes contained in the given Bytes instance.

Returns the number of bytes contained in the given Bytes instance.

def toByteArray(bytes: Bytes): Array[Byte]

Converts the given Bytes instance into a byte array.

Converts the given Bytes instance into a byte array.