BinaryCodec

zio.blocks.schema.codec.BinaryCodec
abstract class BinaryCodec[A] extends Codec[ByteBuffer, ByteBuffer, A]

Represents a specialized codec for encoding and decoding values between binary input and output representations using ByteBuffer.

This abstraction is commonly used with binary formats (e.g., Avro) where both encoding and decoding operations are performed using ByteBuffer as the underlying data representation.

Type parameters

A

The type of values being encoded or decoded.

Attributes

Source
BinaryCodec.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class AvroCodec[A]
class JsonCodec[A]
class MessagePackCodec[A]
class ThriftCodec[A]
class ToonCodec[A]
class XmlCodec[A]
class YamlCodec[A]
Show all

Members list

Value members

Inherited and Abstract methods

def decode(input: ByteBuffer): Either[SchemaError, A]

Decodes the specified input into a value of the target type.

Decodes the specified input into a value of the target type.

Value parameters

input

The input data that needs to be decoded.

Attributes

Returns

Either a SchemaError indicating the decoding failure, or a decoded value.

Inherited from:
Codec
Source
Codec.scala
def encode(value: A, output: ByteBuffer): Unit

Encodes the given value into the specified output representation.

Encodes the given value into the specified output representation.

Value parameters

output

The target output into which the value will be encoded.

value

The value to be encoded.

Attributes

Returns

This method does not return a value.

Inherited from:
Codec
Source
Codec.scala