Class EncoderResultImpl<T>

java.lang.Object
com.lucimber.dbus.codec.encoder.EncoderResultImpl<T>
Type Parameters:
T - The buffer's type.
All Implemented Interfaces:
EncoderResult<T>

public final class EncoderResultImpl<T> extends Object implements EncoderResult<T>
Default implementation of the EncoderResult interface.
  • Constructor Details

    • EncoderResultImpl

      public EncoderResultImpl(int byteCount, T buffer)
      Creates a new instance with the necessary arguments.
      Parameters:
      byteCount - The number of encoded bytes.
      buffer - The buffer that contains the result of the encoding.
  • Method Details

    • getProducedBytes

      public int getProducedBytes()
      Description copied from interface: EncoderResult
      Gets the number of bytes, that have been encoded by this encoder while producing the result.
      Specified by:
      getProducedBytes in interface EncoderResult<T>
      Returns:
      An integer as the number of encoded bytes.
    • getBuffer

      public T getBuffer()
      Description copied from interface: EncoderResult
      Gets the buffer that contains the result of the encoding.
      Specified by:
      getBuffer in interface EncoderResult<T>
      Returns:
      A buffer.