public abstract class WebSocketMessageWriter extends Object
WebSocketMessageWriter
is used to send binary and text messages. A
reference to WebSocketMessageWriter
is obtained by invoking either
WebSocket.getMessageWriter()
or
WsURLConnection#getMessageWriter() methods after the connection has
been established. Trying to get a reference to {@link WebSocketMessageWriter}
before the connection is established will result in an IOException.
Once the connection is closed, a new {@link WebSocketMessageReader} should be obtained using the aforementioned methods after the connection has been established. Using the old reader will result in IOException.
Constructor and Description |
---|
WebSocketMessageWriter() |
Modifier and Type | Method and Description |
---|---|
abstract void |
writeBinary(ByteBuffer src)
Sends a binary message using the specified payload.
|
abstract void |
writeText(CharSequence src)
Sends a text message using the specified payload.
|
public abstract void writeText(CharSequence src) throws IOException
src
- CharSequence payload of the messageIOException
- if the connection is not open or if the connection
has been closedpublic abstract void writeBinary(ByteBuffer src) throws IOException
src
- ByteBuffer payload of the messageIOException
- if the connection is not open or if the connection
has been closedCopyright © 2014. All Rights Reserved.