public abstract class BinaryMessage extends Message
getStreamedData
will return a Source streaming the data as it comes in.Constructor and Description |
---|
BinaryMessage() |
Modifier and Type | Method and Description |
---|---|
static BinaryMessage |
adapt(BinaryMessage msg) |
BinaryMessage |
asBinaryMessage()
Returns this BinaryMessage if it is a binary message, throws otherwise.
|
abstract BinaryMessage |
asScala() |
TextMessage |
asTextMessage()
Returns this TextMessage if it is a text message, throws otherwise.
|
static BinaryMessage |
create(org.apache.pekko.util.ByteString data)
Creates a strict binary message.
|
static BinaryMessage |
create(org.apache.pekko.stream.javadsl.Source<org.apache.pekko.util.ByteString,?> dataStream)
Creates a streamed binary message.
|
abstract org.apache.pekko.stream.javadsl.Source<org.apache.pekko.util.ByteString,?> |
getStreamedData()
Returns a source of the binary message data.
|
abstract org.apache.pekko.util.ByteString |
getStrictData()
Returns the strict message data if this message is strict, throws otherwise.
|
boolean |
isText()
Is this message a text message?
|
abstract java.util.concurrent.CompletionStage<BinaryMessage.Strict> |
toStrict(long timeoutMillis,
org.apache.pekko.stream.Materializer materializer) |
public static BinaryMessage create(org.apache.pekko.util.ByteString data)
data
- (undocumented)public static BinaryMessage create(org.apache.pekko.stream.javadsl.Source<org.apache.pekko.util.ByteString,?> dataStream)
dataStream
- (undocumented)public static BinaryMessage adapt(BinaryMessage msg)
public abstract org.apache.pekko.stream.javadsl.Source<org.apache.pekko.util.ByteString,?> getStreamedData()
public abstract org.apache.pekko.util.ByteString getStrictData()
public boolean isText()
Message
asTextMessage
will return this
text message, if false, asBinaryMessage
will return this binary message.public TextMessage asTextMessage()
Message
asTextMessage
in class Message
public BinaryMessage asBinaryMessage()
Message
asBinaryMessage
in class Message
public abstract BinaryMessage asScala()
public abstract java.util.concurrent.CompletionStage<BinaryMessage.Strict> toStrict(long timeoutMillis, org.apache.pekko.stream.Materializer materializer)