Interface CustomDecoder

  • All Known Subinterfaces:
    CustomProcessor

    public interface CustomDecoder
    A custom decoder interface. Implementing classes can be called from inside a .ksy file using `process: XXX` syntax.

    This interface is sufficient for custom processing routines that will only be used from generated format libraries that are read-only (only capable of parsing, not serialization). To support generated source files compiled in --read-write mode, implement CustomProcessor instead.

    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      byte[] decode​(byte[] src)
      Decodes a given byte array, according to some custom algorithm (specific to implementing class) and parameters given in the constructor, returning another byte array.
    • Method Detail

      • decode

        byte[] decode​(byte[] src)
        Decodes a given byte array, according to some custom algorithm (specific to implementing class) and parameters given in the constructor, returning another byte array.

        This method is used in parsing. Its counterpart is CustomProcessor.encode(byte[]), which is used in serialization.

        Parameters:
        src - source byte array
        Returns:
        decoded byte array