ByteAccess

io.bullet.borer.ByteAccess
See theByteAccess companion object
trait ByteAccess[Bytes]

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

Attributes

Companion:
object
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
object ForByteArray.type
object ForByteBuffer.type

Members list

Concise view

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.

Attributes

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.

Attributes

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.

Attributes

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.

Attributes

def empty: Bytes

Returns an empty Bytes instance.

Returns an empty Bytes instance.

Attributes

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

Converts the given byte array into a Bytes instance.

Converts the given byte array into a Bytes instance.

Attributes

def isEmpty(bytes: Bytes): Boolean

Returns true iff the given Bytes instance is empty.

Returns true iff the given Bytes instance is empty.

Attributes

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.

Attributes

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

Converts the given Bytes instance into a byte array.

Converts the given Bytes instance into a byte array.

Attributes