Interface ToByteBufMapper<T>

Type Parameters:
T - Internal representation type
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@NonNullByDefault @FunctionalInterface public interface ToByteBufMapper<T>
Interface for transforming internal represetation to bytes.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    objectToBytes(T obj, ByteBuf buf)
    Converts an object into a series of bytes in the specified ByteBuf.
  • Method Details

    • objectToBytes

      boolean objectToBytes(T obj, ByteBuf buf) throws IOException
      Converts an object into a series of bytes in the specified ByteBuf.
      Parameters:
      obj - the object
      buf - target buffer
      Returns:
      true if the writeout completed, false if the buffer has insufficient capacity
      Throws:
      IOException - if an I/O error occurs