Class IrEncoder

java.lang.Object
uk.co.real_logic.sbe.ir.IrEncoder
All Implemented Interfaces:
AutoCloseable

public class IrEncoder extends Object implements AutoCloseable
Encoder for Ir representing an SBE schema which can be written to a buffer or file.
  • Constructor Details

    • IrEncoder

      public IrEncoder(String fileName, Ir ir)
      Construct an encoder for Ir to a file. An existing file will be overwritten.
      Parameters:
      fileName - into which the Ir will be encoded.
      ir - to be encoded into the file.
    • IrEncoder

      public IrEncoder(ByteBuffer buffer, Ir ir)
      Construct an encoder for Ir to a ByteBuffer.
      Parameters:
      buffer - into which the Ir will be encoded.
      ir - to be encoded into the buffer.
  • Method Details

    • close

      public void close()
      Specified by:
      close in interface AutoCloseable
    • encode

      public int encode()
      Encode the provided Ir and return the length in bytes encoded.
      Returns:
      encode the provided Ir and return the length in bytes encoded.