Class BinaryMessage
java.lang.Object
org.apache.pekko.http.javadsl.model.ws.Message
org.apache.pekko.http.javadsl.model.ws.BinaryMessage
- Direct Known Subclasses:
- BinaryMessage.Streamed,- BinaryMessage.Strict
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 SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic BinaryMessageadapt(BinaryMessage msg) Returns this BinaryMessage if it is a binary message, throws otherwise.abstract BinaryMessageasScala()Returns this TextMessage if it is a text message, throws otherwise.static BinaryMessagecreate(org.apache.pekko.stream.javadsl.Source<org.apache.pekko.util.ByteString, ?> dataStream) Creates a streamed binary message.static BinaryMessagecreate(org.apache.pekko.util.ByteString data) Creates a strict binary message.abstract org.apache.pekko.stream.javadsl.Source<org.apache.pekko.util.ByteString,?> Returns a source of the binary message data.abstract org.apache.pekko.util.ByteStringReturns the strict message data if this message is strict, throws otherwise.booleanisText()Is this message a text message?abstract CompletionStage<BinaryMessage.Strict>toStrict(long timeoutMillis, org.apache.pekko.stream.Materializer materializer) 
- 
Constructor Details- 
BinaryMessagepublic BinaryMessage()
 
- 
- 
Method Details- 
createCreates a strict binary message.- Parameters:
- data- (undocumented)
- Returns:
- (undocumented)
 
- 
createpublic static BinaryMessage create(org.apache.pekko.stream.javadsl.Source<org.apache.pekko.util.ByteString, ?> dataStream) Creates a streamed binary message.- Parameters:
- dataStream- (undocumented)
- Returns:
- (undocumented)
 
- 
adapt
- 
getStreamedDatapublic abstract org.apache.pekko.stream.javadsl.Source<org.apache.pekko.util.ByteString,?> getStreamedData()Returns a source of the binary message data.- Returns:
- (undocumented)
 
- 
getStrictDatapublic abstract org.apache.pekko.util.ByteString getStrictData()Returns the strict message data if this message is strict, throws otherwise.- Returns:
- (undocumented)
 
- 
isTextpublic boolean isText()Description copied from class:MessageIs this message a text message? If true,Message.asTextMessage()will return this text message, if false,Message.asBinaryMessage()will return this binary message.
- 
asTextMessageDescription copied from class:MessageReturns this TextMessage if it is a text message, throws otherwise.- Specified by:
- asTextMessagein class- Message
- Returns:
- (undocumented)
 
- 
asBinaryMessageDescription copied from class:MessageReturns this BinaryMessage if it is a binary message, throws otherwise.- Specified by:
- asBinaryMessagein class- Message
- Returns:
- (undocumented)
 
- 
asScala
- 
toStrictpublic abstract CompletionStage<BinaryMessage.Strict> toStrict(long timeoutMillis, org.apache.pekko.stream.Materializer materializer) 
 
-