Uses of Interface
io.bytestreams.codec.core.Codec

Packages that use Codec
Package
Description
 
  • Uses of Codec in io.bytestreams.codec.core

    Classes in io.bytestreams.codec.core that implement Codec
    Modifier and Type
    Class
    Description
    class 
    A codec for fixed-length binary data.
    class 
    Codec for Numbers encoded as fixed-length binary, big-endian unless BinaryNumberCodec.withOrder(ByteOrder) says otherwise.
    class 
    A codec for boolean values encoded as a single byte.
    class 
    A codec for discriminated unions where a tag determines which codec to use for the value.
    class 
    A codec for constant byte sequences such as magic numbers, version bytes, and protocol signatures.
    class 
    A codec for fixed-length character strings.
    class 
    A codec for fixed-length hexadecimal strings.
    class 
    A codec for encoding and decoding fixed-length lists of values.
    class 
    A codec that defers resolution to first use, enabling recursive codec definitions.
    class 
    A codec that always throws, indicating no implementation has been provided.
    class 
    A codec that encodes and decodes a pair of values sequentially.
    class 
    A codec that captures raw bytes during decoding, returning a Recorded value containing both the decoded value and the original wire bytes.
    class 
    A codec for objects with sequential fields.
    class 
    A codec for variable-length character strings that reads all remaining bytes from the stream.
    class 
    A codec for variable-length hexadecimal strings that reads all remaining bytes from the stream.
    class 
    A codec for encoding and decoding lists of values by reading items until EOF.
    class 
    TaggedObjectCodec<T extends Tagged<T,K>, K>
    A codec for objects with tag-identified fields.
    class 
    A codec that encodes and decodes a triple of values sequentially.
    class 
    A codec for variable-length values where the byte count is encoded as a prefix.
    class 
    A codec for variable-length values where the item count is encoded as a prefix.
    Methods in io.bytestreams.codec.core that return Codec
    Modifier and Type
    Method
    Description
    <V> Codec<V>
    PairCodec.as(BiFunction<A,B,V> constructor, Function<V,A> getFirst, Function<V,B> getSecond)
    Maps this pair codec to a domain type.
    <V> Codec<V>
    TripleCodec.as(TriFunction<A,B,C,V> constructor, Function<V,A> getFirst, Function<V,B> getSecond, Function<V,C> getThird)
    Maps this triple codec to a domain type.
    static Codec<String>
    Codecs.ascii()
    Creates a variable-length US-ASCII string codec.
    static Codec<String>
    Codecs.ascii(int length)
    Creates a fixed-length US-ASCII string codec.
    static Codec<String>
    Codecs.ascii(Codec<Integer> lengthCodec)
    Creates a variable-length US-ASCII string codec where the code point count is encoded as a prefix.
    Codecs.asciiBigInt(int digits)
    Creates an ASCII numeric codec for values wider than a long holds.
    static Codec<Integer>
    Codecs.asciiInt(int digits)
    Creates a fixed-length ASCII numeric codec that decodes to Integer.
    static Codec<Long>
    Codecs.asciiLong(int digits)
    Creates a fixed-length ASCII numeric codec that decodes to Long.
    Codecs.bcdBigInt(int digits)
    Creates a BCD codec for values wider than a long holds.
    static Codec<Integer>
    Codecs.bcdInt(int digits)
    Creates a fixed-length BCD (Binary Coded Decimal) codec that decodes to Integer.
    static Codec<Long>
    Codecs.bcdLong(int digits)
    Creates a fixed-length BCD (Binary Coded Decimal) codec that decodes to Long.
    static Codec<byte[]>
    Codecs.binary()
    Creates a variable-length binary codec that reads all remaining bytes from the stream.
    static Codec<byte[]>
    Codecs.binary(int length)
    Creates a fixed-length binary codec.
    static Codec<byte[]>
    Codecs.binary(Codec<Integer> lengthCodec)
    Creates a variable-length binary codec where the byte count is encoded as a prefix.
    static Codec<Boolean>
    Codecs.bool()
    Creates a boolean codec (single byte: 0x00 = false, 0x01 = true).
    static <T,V> Codec<V>
    Codecs.checked(Codec<V> valueCodec, Codec<T> checkCodec, Function<byte[],T> compute)
    Creates a codec for a value followed by a value computed over its bytes — an LRC, a CRC, a checksum or a MAC.
    FieldSpec.codec()
     
    static Codec<byte[]>
    Codecs.constant(byte[] expected)
    Creates a constant codec that always writes the expected bytes on encode (ignoring the input value) and validates that the bytes match on decode.
    static Codec<String>
    Codecs.ebcdic()
    Creates a variable-length EBCDIC (IBM1047) string codec.
    static Codec<String>
    Codecs.ebcdic(int length)
    Creates a fixed-length EBCDIC (IBM1047) string codec.
    static Codec<String>
    Codecs.ebcdic(Codec<Integer> lengthCodec)
    Creates a variable-length EBCDIC (IBM1047) string codec where the code point count is encoded as a prefix.
    Codecs.ebcdicBigInt(int digits)
    Creates an EBCDIC numeric codec for values wider than a long holds.
    static Codec<Integer>
    Codecs.ebcdicInt(int digits)
    Creates a fixed-length EBCDIC numeric codec that decodes to Integer.
    static Codec<Long>
    Codecs.ebcdicLong(int digits)
    Creates a fixed-length EBCDIC numeric codec that decodes to Long.
    static Codec<Float>
    Codecs.float32()
    Creates a codec for float values (IEEE 754 single-precision, 4 bytes).
    static Codec<Float>
    Codecs.float32(ByteOrder order)
    Creates a codec for IEEE 754 single-precision values, encoded as 4-byte binary in the given byte order.
    static Codec<Double>
    Codecs.float64()
    Creates a codec for double values (IEEE 754 double-precision, 8 bytes).
    static Codec<Double>
    Codecs.float64(ByteOrder order)
    Creates a codec for IEEE 754 double-precision values, encoded as 8-byte binary in the given byte order.
    static Codec<String>
    Codecs.hex()
    Creates a variable-length hex string codec.
    static Codec<String>
    Codecs.hex(int length)
    Creates a fixed-length hex string codec.
    static Codec<String>
    Codecs.hex(Codec<Integer> lengthCodec)
    Creates a variable-length hex string codec where the hex digit count is encoded as a prefix.
    static Codec<Short>
    Codecs.int16()
    Creates a codec for signed short values (-32768 to 32767), encoded as 2-byte big-endian binary.
    static Codec<Short>
    Codecs.int16(ByteOrder order)
    Creates a codec for signed short values (-32768 to 32767), encoded as 2-byte binary in the given byte order.
    static Codec<Integer>
    Codecs.int32()
    Creates a codec for signed integer values (-2147483648 to 2147483647), encoded as 4-byte big-endian binary.
    static Codec<Integer>
    Codecs.int32(ByteOrder order)
    Creates a codec for signed integer values (-2147483648 to 2147483647), encoded as 4-byte binary in the given byte order.
    static Codec<Long>
    Codecs.int64()
    Creates a codec for signed long values, encoded as 8-byte big-endian binary.
    static Codec<Long>
    Codecs.int64(ByteOrder order)
    Creates a codec for signed long values, encoded as 8-byte binary in the given byte order.
    static Codec<String>
    Codecs.latin1()
    Creates a variable-length ISO-8859-1 (Latin-1) string codec.
    static Codec<String>
    Codecs.latin1(int length)
    Creates a fixed-length ISO-8859-1 (Latin-1) string codec.
    static Codec<String>
    Codecs.latin1(Codec<Integer> lengthCodec)
    Creates a variable-length ISO-8859-1 (Latin-1) string codec where the code point count is encoded as a prefix.
    static <V> Codec<V>
    Codecs.lazy(Supplier<Codec<V>> supplier)
    Creates a lazy codec that defers resolution to first use, enabling recursive definitions.
    static <V> Codec<List<V>>
    Codecs.listOf(int length, Codec<V> itemCodec)
    Creates a fixed-length list codec that encodes/decodes exactly length items.
    static <V> Codec<List<V>>
    Codecs.listOf(Codec<Integer> lengthCodec, Codec<V> itemCodec)
    Creates a variable-length list codec where the item count is encoded as a prefix.
    static <V> Codec<List<V>>
    Codecs.listOf(Codec<V> itemCodec)
    Creates a stream list codec that reads items until EOF.
    static Codec<String>
    Codecs.ofCharset(Charset charset)
    Creates a variable-length string codec with the specified charset.
    static Codec<String>
    Codecs.ofCharset(Charset charset, int length)
    Creates a fixed-length string codec with the specified charset.
    static Codec<String>
    Codecs.ofCharset(Charset charset, Codec<Integer> lengthCodec)
    Creates a variable-length string codec where the code point count is encoded as a prefix.
    static Codec<Integer>
    Codecs.packedInt(int digits)
    Creates a codec for signed packed decimal integers, the format COBOL declares as COMP-3.
    static Codec<Long>
    Codecs.packedLong(int digits)
    Creates a codec for signed packed decimal longs, the format COBOL declares as COMP-3.
    static <V> Codec<V>
    Codecs.prefixed(Codec<Integer> lengthCodec, Codec<V> valueCodec)
    Creates a variable-length codec where the byte count is encoded as a prefix.
    static <V> Codec<V>
    Codecs.prefixed(Codec<Integer> lengthCodec, ToIntFunction<V> lengthOf, IntFunction<Codec<V>> codecFactory)
    Creates a variable-length codec where the item count is encoded as a prefix.
    static <T,V> Codec<List<V>>
    Codecs.repeatWhile(Codec<T> peekCodec, Predicate<T> accepts, Codec<V> itemCodec)
    Creates a codec for a run of items that continues while a lookahead matches.
    static <V> Codec<V>
    Codecs.terminated(Codec<V> valueCodec, byte[] terminator)
    Creates a variable-length codec where the value is followed by a terminator.
    static <V> Codec<V>
    Codecs.terminated(Codec<V> valueCodec, byte[] terminator, Codecs.Termination termination)
    Creates a variable-length codec where the value is followed by a terminator, with an explicit policy for a final value that is not terminated.
    static Codec<Integer>
    Codecs.uint16()
    Creates a codec for unsigned short values (0 to 65535), encoded as 2-byte big-endian binary.
    static Codec<Integer>
    Codecs.uint16(ByteOrder order)
    Creates a codec for unsigned short values (0 to 65535), encoded as 2-byte binary in the given byte order.
    static Codec<Integer>
    Codecs.uint24()
    Creates a codec for unsigned three-byte values (0 to 16777215), encoded as big-endian binary.
    static Codec<Integer>
    Codecs.uint24(ByteOrder order)
    Creates a codec for unsigned three-byte values (0 to 16777215), encoded as binary in the given byte order.
    static Codec<Long>
    Codecs.uint32()
    Creates a codec for unsigned integer values (0 to 4294967295), encoded as 4-byte big-endian binary.
    static Codec<Long>
    Codecs.uint32(ByteOrder order)
    Creates a codec for unsigned integer values (0 to 4294967295), encoded as 4-byte binary in the given byte order.
    static Codec<Integer>
    Codecs.uint8()
    Creates a codec for unsigned byte values (0 to 255), encoded as 1-byte binary.
    static Codec<String>
    Codecs.utf8()
    Creates a variable-length UTF-8 string codec.
    static Codec<String>
    Codecs.utf8(int length)
    Creates a fixed-length UTF-8 string codec.
    static Codec<String>
    Codecs.utf8(Codec<Integer> lengthCodec)
    Creates a variable-length UTF-8 string codec where the code point count is encoded as a prefix.
    default Codec<V>
    Codec.validate(Validator<V> validator)
    Returns a new codec that applies a Validator on both encode and decode.
    default Codec<V>
    Codec.validate(Predicate<V> check, String message)
    Returns a new codec that checks the value on both encode and decode.
    default Codec<V>
    Codec.validate(Predicate<V> check, Function<V,String> message)
    Returns a new codec that checks the value on both encode and decode, deriving the error message from the rejected value.
    default <U> Codec<U>
    Codec.xmap(Converter<V,U> converter)
    Returns a new codec that maps between types using a Converter.
    default <U> Codec<U>
    Codec.xmap(Function<V,U> decoder, Function<U,V> encoder)
    Returns a new codec that applies bidirectional mapping functions to transform between value types.
    static Codec<Integer>
    Codecs.zonedInt(int digits)
    Creates a codec for EBCDIC zoned decimal integers, the format COBOL declares as DISPLAY.
    static Codec<Long>
    Codecs.zonedLong(int digits)
    Creates a codec for EBCDIC zoned decimal longs, the format COBOL declares as DISPLAY.
    Methods in io.bytestreams.codec.core with parameters of type Codec
    Modifier and Type
    Method
    Description
    static Codec<String>
    Codecs.ascii(Codec<Integer> lengthCodec)
    Creates a variable-length US-ASCII string codec where the code point count is encoded as a prefix.
    static Codec<byte[]>
    Codecs.binary(Codec<Integer> lengthCodec)
    Creates a variable-length binary codec where the byte count is encoded as a prefix.
    static <T extends Tagged<T,K>, K>
    TaggedObjectCodec.Builder<T,K>
    TaggedObjectCodec.builder(Supplier<T> factory, Codec<K> tagCodec)
    Creates a new builder for constructing a TaggedObjectCodec.
    static <T,V> Codec<V>
    Codecs.checked(Codec<V> valueCodec, Codec<T> checkCodec, Function<byte[],T> compute)
    Creates a codec for a value followed by a value computed over its bytes — an LRC, a CRC, a checksum or a MAC.
    static <T,V> ChoiceCodec.Builder<T,V>
    Codecs.choice(Codec<T> tagCodec)
    Creates a new builder for a choice codec that encodes discriminated unions.
    SequentialObjectCodec.Builder.constant(String name, Codec<V> codec, V value)
    Adds a fixed-value field that is present on the wire but not stored on the object.
    SequentialObjectCodec.Builder.constant(String name, Codec<V> codec, V value, Predicate<V> accepts)
    Adds a fixed-value field that is written on encode but matched loosely on decode.
    TaggedObjectCodec.Builder.defaultCodec(Codec<?> defaultCodec)
    Sets the default codec for unregistered tags.
    static Codec<String>
    Codecs.ebcdic(Codec<Integer> lengthCodec)
    Creates a variable-length EBCDIC (IBM1047) string codec where the code point count is encoded as a prefix.
    static <T extends DataObject, V>
    FieldSpec<T,V>
    DataObject.field(String name, Codec<V> codec)
    Creates a FieldSpec backed by the object's internal map.
    static <T extends DataObject, V>
    FieldSpec<T,V>
    DataObject.field(String name, Codec<V> codec, Predicate<? super T> presence)
    Creates a FieldSpec backed by the object's internal map with a presence predicate.
    SequentialObjectCodec.Builder.field(String name, Codec<V> codec, Function<? super T, V> getter, BiConsumer<? super T, V> setter)
    Adds a required field to the codec.
    SequentialObjectCodec.Builder.field(String name, Codec<V> codec, Function<? super T, V> getter, BiConsumer<? super T, V> setter, Predicate<? super T> presence)
    Adds a field to the codec with a presence predicate.
    static Codec<String>
    Codecs.hex(Codec<Integer> lengthCodec)
    Creates a variable-length hex string codec where the hex digit count is encoded as a prefix.
    static Object
    Inspector.inspect(Codec<?> codec, Object value)
    Returns a structured representation of the given value by walking the codec tree.
    static Codec<String>
    Codecs.latin1(Codec<Integer> lengthCodec)
    Creates a variable-length ISO-8859-1 (Latin-1) string codec where the code point count is encoded as a prefix.
    static <V> Codec<List<V>>
    Codecs.listOf(int length, Codec<V> itemCodec)
    Creates a fixed-length list codec that encodes/decodes exactly length items.
    static <V> Codec<List<V>>
    Codecs.listOf(Codec<Integer> lengthCodec, Codec<V> itemCodec)
    Creates a variable-length list codec where the item count is encoded as a prefix.
    static <V> Codec<List<V>>
    Codecs.listOf(Codec<V> itemCodec)
    Creates a stream list codec that reads items until EOF.
    static <T,V> FieldSpec<T,V>
    FieldSpec.of(String name, Codec<V> codec, Function<? super T, V> getter, BiConsumer<? super T, V> setter)
    Creates a FieldSpec from explicit getter and setter functions.
    static <T,V> FieldSpec<T,V>
    FieldSpec.of(String name, Codec<V> codec, Function<? super T, V> getter, BiConsumer<? super T, V> setter, Predicate<? super T> presence)
    Creates a FieldSpec from explicit getter, setter, and presence predicate.
    static <T> RecordingCodec<T>
    RecordingCodec.of(Codec<T> delegate)
    Creates a new recording codec wrapping the given delegate.
    static Codec<String>
    Codecs.ofCharset(Charset charset, Codec<Integer> lengthCodec)
    Creates a variable-length string codec where the code point count is encoded as a prefix.
    <S extends V>
    ChoiceCodec.Builder<T,V>
    ChoiceCodec.Builder.on(T tag, Class<S> type, Codec<S> codec)
    Registers an alternative.
    static <A,B> PairCodec<A,B>
    Codecs.pair(Codec<A> first, Codec<B> second)
    Creates a pair codec that encodes and decodes two values sequentially.
    static <V> Codec<V>
    Codecs.prefixed(Codec<Integer> lengthCodec, Codec<V> valueCodec)
    Creates a variable-length codec where the byte count is encoded as a prefix.
    static <V> Codec<V>
    Codecs.prefixed(Codec<Integer> lengthCodec, ToIntFunction<V> lengthOf, IntFunction<Codec<V>> codecFactory)
    Creates a variable-length codec where the item count is encoded as a prefix.
    static <T,V> Codec<List<V>>
    Codecs.repeatWhile(Codec<T> peekCodec, Predicate<T> accepts, Codec<V> itemCodec)
    Creates a codec for a run of items that continues while a lookahead matches.
    TaggedObjectCodec.Builder.tag(K tag, Codec<?> codec)
    Registers a codec for a specific tag.
    Codecs.tagged(Codec<K> tagCodec)
    Creates a new builder for a tagged object codec using TaggedData.
    static <T extends Tagged<T,K>, K>
    TaggedObjectCodec.Builder<T,K>
    Codecs.tagged(Supplier<T> factory, Codec<K> tagCodec)
    Creates a new builder for a tagged object codec.
    static <V> Codec<V>
    Codecs.terminated(Codec<V> valueCodec, byte[] terminator)
    Creates a variable-length codec where the value is followed by a terminator.
    static <V> Codec<V>
    Codecs.terminated(Codec<V> valueCodec, byte[] terminator, Codecs.Termination termination)
    Creates a variable-length codec where the value is followed by a terminator, with an explicit policy for a final value that is not terminated.
    static <A,B,C> TripleCodec<A,B,C>
    Codecs.triple(Codec<A> first, Codec<B> second, Codec<C> third)
    Creates a triple codec that encodes and decodes three values sequentially.
    static Codec<String>
    Codecs.utf8(Codec<Integer> lengthCodec)
    Creates a variable-length UTF-8 string codec where the code point count is encoded as a prefix.
    Method parameters in io.bytestreams.codec.core with type arguments of type Codec
    Modifier and Type
    Method
    Description
    static <V> Codec<V>
    Codecs.lazy(Supplier<Codec<V>> supplier)
    Creates a lazy codec that defers resolution to first use, enabling recursive definitions.
    static <V> Codec<V>
    Codecs.prefixed(Codec<Integer> lengthCodec, ToIntFunction<V> lengthOf, IntFunction<Codec<V>> codecFactory)
    Creates a variable-length codec where the item count is encoded as a prefix.
    Constructors in io.bytestreams.codec.core with parameters of type Codec
    Modifier
    Constructor
    Description
     
    FixedListCodec(Codec<V> itemCodec, int length)
    Creates a new fixed list codec that uses ArrayList for decoded lists.
     
    FixedListCodec(Codec<V> itemCodec, int length, Supplier<List<V>> listFactory)
    Creates a new fixed list codec with a custom list factory.
     
    RecordingCodec(Codec<T> delegate)
     
     
    StreamListCodec(Codec<V> itemCodec)
    Creates a new stream list codec that uses ArrayList for decoded lists.
     
    StreamListCodec(Codec<V> itemCodec, Supplier<List<V>> listFactory)
    Creates a new stream list codec with a custom list factory.