Class SocketMessageDecoder

java.lang.Object
technology.sola.engine.networking.socket.SocketMessageDecoder

@NullMarked public class SocketMessageDecoder extends Object
SocketMessageDecoder is responsible for decoding SocketMessages from payloads received over sockets.
  • Constructor Details

    • SocketMessageDecoder

      public SocketMessageDecoder()
  • Method Details

    • decodeForRaw

      public @Nullable SocketMessage decodeForRaw(BufferedInputStream bufferedInputStream) throws IOException
      Decodes a raw socket encoded message from the client. Note, this is a blocking operation.
      Parameters:
      bufferedInputStream - the BufferedInputStream to read the input from
      Returns:
      the decoded message or null if disconnected
      Throws:
      IOException - if an I/O error occurs
    • decodeForWeb

      public @Nullable SocketMessage decodeForWeb(BufferedInputStream bufferedInputStream) throws IOException
      Decodes a web socket encoded message from the client. Note, this is a blocking operation.
      Parameters:
      bufferedInputStream - the BufferedInputStream to read the input from
      Returns:
      the decoded message or null if disconnected
      Throws:
      IOException - if an I/O error occurs