Class TextFrame


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

      • TextFrame

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

        public TextFrame​(Frame frame,
                         java.nio.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​(java.lang.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 Detail

      • getTextPayload

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

        public java.nio.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 java.lang.String toString()
        Overrides:
        toString in class Frame