TextCodec

zio.blocks.schema.codec.TextCodec
abstract class TextCodec[A] extends Codec[CharBuffer, CharBuffer, A]

Represents a specialized codec for encoding and decoding values between text-based input and output representations using CharBuffer.

This abstraction is typically used with text-based formats (e.g., JSON) where both encoding and decoding operations are performed using CharBuffer as the underlying data representation.

Type parameters

A

The type of values being encoded or decoded.

Attributes

Source
TextCodec.scala
Graph
Supertypes
class Object
trait Matchable
class Any
Known subtypes
class CsvCodec[A]

Members list

Value members

Inherited and Abstract methods

def decode(input: CharBuffer): 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: CharBuffer): 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