static <D, E, DX extends Throwable, EX extends Throwable> @NotNull Codec<D, E, DX, EX> codec(final @NotNull Decoder<D, E, DX> decoder, final @NotNull Encoder<D, E, EX> encoder) {
    return new Codec<D, E, DX, EX>() {
      @Override
      public @NotNull D decode(final @NotNull E encoded) throws DX {
        return decoder.decode(encoded);
      }

      @Override
      public @NotNull E encode(final @NotNull D decoded) throws EX {
        return encoder.encode(decoded);
      }
    };
  }
Creates a codec.

@param decoder the decoder
@param encoder the encoder
@param <D> the decoded type
@param <E> the encoded type
@param <DX> the decode exception type
@param <EX> the encode exception type
@return a codec
@since 4.10.0
api/src/main/java/net/kyori/adventure/util/Codec.java