Interface Codec

  • All Known Implementing Classes:
    EoCodec, JavaCodec, PlainLongCodec

    public interface Codec
    Classes that can transform objects to byte arrays and vice versa.
    Since:
    0.8
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      Object decode​(byte[] bytes, org.eolang.jeo.representation.bytecode.DataType type)
      Decodes a byte array to an object.
      byte[] encode​(Object object, org.eolang.jeo.representation.bytecode.DataType type)
      Encodes an object to a byte array.
    • Method Detail

      • encode

        byte[] encode​(Object object,
                      org.eolang.jeo.representation.bytecode.DataType type)
        Encodes an object to a byte array.
        Parameters:
        object - Object.
        type - Data type.
        Returns:
        Byte array.
      • decode

        Object decode​(byte[] bytes,
                      org.eolang.jeo.representation.bytecode.DataType type)
        Decodes a byte array to an object.
        Parameters:
        bytes - Byte array.
        type - Data type.
        Returns:
        Object.