Class BinaryMessage

  • Direct Known Subclasses:
    BinaryMessage.Streamed, BinaryMessage.Strict

    public abstract class BinaryMessage
    extends Message
    Represents a WebSocket binary message. A binary message can either be strict in which case the complete data is already available or it can be streamed in which case getStreamedData() will return a Source streaming the data as it comes in.
    • Constructor Detail

      • BinaryMessage

        public BinaryMessage()
    • Method Detail

      • create

        public static BinaryMessage create​(akka.util.ByteString data)
        Creates a strict binary message.
        Parameters:
        data - (undocumented)
        Returns:
        (undocumented)
      • create

        public static BinaryMessage create​(akka.stream.javadsl.Source<akka.util.ByteString,​?> dataStream)
        Creates a streamed binary message.
        Parameters:
        dataStream - (undocumented)
        Returns:
        (undocumented)
      • getStreamedData

        public abstract akka.stream.javadsl.Source<akka.util.ByteString,​?> getStreamedData()
        Returns a source of the binary message data.
        Returns:
        (undocumented)
      • getStrictData

        public abstract akka.util.ByteString getStrictData()
        Returns the strict message data if this message is strict, throws otherwise.
        Returns:
        (undocumented)
      • asTextMessage

        public TextMessage asTextMessage()
        Description copied from class: Message
        Returns this TextMessage if it is a text message, throws otherwise.
        Specified by:
        asTextMessage in class Message
        Returns:
        (undocumented)
      • asBinaryMessage

        public BinaryMessage asBinaryMessage()
        Description copied from class: Message
        Returns this BinaryMessage if it is a binary message, throws otherwise.
        Specified by:
        asBinaryMessage in class Message
        Returns:
        (undocumented)
      • toStrict

        public abstract java.util.concurrent.CompletionStage<BinaryMessage.Strict> toStrict​(long timeoutMillis,
                                                                                            akka.stream.Materializer materializer)