Interface STouchProtocol.ObjectReaderWriter<T>

All Known Implementing Classes:
STouchProtocol.ButtonReaderWriter, STouchProtocol.ByteReaderWriter, STouchProtocol.CharacterRotateReaderWriter, STouchProtocol.CircleReaderWriter, STouchProtocol.ColorReaderWriter, STouchProtocol.CommandReaderWriter, STouchProtocol.CoordinatesReaderWriter, STouchProtocol.IntegerReaderWriter, STouchProtocol.MacAddressReaderWriter, STouchProtocol.RectangleReaderWriter, STouchProtocol.RoundRectangleReaderWriter, STouchProtocol.ShortIntegerReaderWriter, STouchProtocol.SymbolReaderWriter, STouchProtocol.TextReaderWriter, STouchProtocol.TextRotateReaderWriter, STouchProtocol.TextXYReaderWriter
Enclosing class:
STouchProtocol

public static interface STouchProtocol.ObjectReaderWriter<T>
Interface for parsing and processing commands.
  • Method Summary

    Modifier and Type Method Description
    T readFromBuffer​(java.nio.ByteBuffer buffer)
    Parses the command from the received buffer and returns a parsed object.
    int writeToBuffer​(java.nio.ByteBuffer buffer, T object)
    Converts the parsed object into the reply buffer.
  • Method Details

    • readFromBuffer

      T readFromBuffer​(java.nio.ByteBuffer buffer)
      Parses the command from the received buffer and returns a parsed object.
      Parameters:
      buffer - the buffer containing the data to read
      Returns:
      the parsed object
    • writeToBuffer

      int writeToBuffer​(java.nio.ByteBuffer buffer, T object)
      Converts the parsed object into the reply buffer.
      Parameters:
      buffer - the buffer to write to
      object - the object to convert
      Returns:
      the length of the bytes written to the buffer