Class TextFrame


public class TextFrame extends TyrusFrame
Text frame representation.
Author:
Pavel Bucek
  • Constructor Details

    • TextFrame

      public TextFrame(Frame frame, ByteBuffer remainder)
      Constructor.
      Parameters:
      frame - original (text) frame.
      remainder - UTF-8 decoding remainder from previously processed frame.
    • TextFrame

      public TextFrame(Frame frame, ByteBuffer remainder, boolean continuation)
      Constructor.
      Parameters:
      frame - original (text) frame.
      remainder - UTF-8 decoding remainder from previously processed frame.
      continuation - true when this frame is continuation frame, false otherwise.
    • TextFrame

      public TextFrame(String message, boolean continuation, boolean fin)
      Constructor.
      Parameters:
      message - text message (will be encoded using strict UTF-8 encoding).
      continuation - true when this frame is continuation frame, false otherwise.
      fin - true when this frame is last in current partial message batch. Standard (non-continuous) frames have this bit set to true.
  • Method Details

    • getTextPayload

      public String getTextPayload()
      Get text payload.
      Returns:
      text payload.
    • getRemainder

      public ByteBuffer getRemainder()
      Remainder after UTF-8 decoding.

      This might be removed in the future, if encoding part will be separated from text frame impl.

      Returns:
      UTF-8 decoding remainder. Used internally to decoding next incoming frame.
    • respond

      public void respond(TyrusWebSocket socket)
      Description copied from class: TyrusFrame
      Execution part of frame processing.
      Specified by:
      respond in class TyrusFrame
      Parameters:
      socket - socket on which the appropriate action will be performed.
    • toString

      public String toString()
      Overrides:
      toString in class Frame