java.lang.Object
org.eolang.jeo.representation.bytecode.EoCodec
All Implemented Interfaces:
Codec

public final class EoCodec extends Object implements Codec
EO codec. Converts primitive types to byte arrays and vice versa.
Since:
0.8
  • Constructor Summary

    Constructors
    Constructor
    Description
    Constructor.
  • Method Summary

    Modifier and Type
    Method
    Description
    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.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • EoCodec

      public EoCodec()
      Constructor.
  • Method Details

    • encode

      public byte[] encode(Object object, org.eolang.jeo.representation.bytecode.DataType type)
      Description copied from interface: Codec
      Encodes an object to a byte array.
      Specified by:
      encode in interface Codec
      Parameters:
      object - Object.
      type - Data type.
      Returns:
      Byte array.
    • decode

      public Object decode(byte[] bytes, org.eolang.jeo.representation.bytecode.DataType type)
      Description copied from interface: Codec
      Decodes a byte array to an object.
      Specified by:
      decode in interface Codec
      Parameters:
      bytes - Byte array.
      type - Data type.
      Returns:
      Object.