In compliance to the WebSocket spec, this reader always uses the StandardCharsets#UTF_8.
| Modifier and Type | Field and Description |
|---|---|
| private final ByteBuffer | |
| private final MessageInputStream | |
| private final CharsetDecoder |
| Access | Constructor and Description |
|---|---|
| public |
| Modifier and Type | Method and Description |
|---|---|
| public void | accept(Frame
the frame to consume frame, Callback the callback to complete when the frame is consumed callback)Implements org. Consumes the WebSocket frame, possibly asynchronously when this method has returned. |
| public void | close()
Implements abstract java. Implements java. Closes the stream and releases any system resources associated with it. |
| public void | fail(Throwable
the cause of the failure failure)Overrides default org. Fails this |
| public int | read(char[]
Destination buffer chars, int Offset at which to start storing characters off, int Maximum number of characters to read len)Implements abstract java. Reads characters into a portion of an array. |
| buffer | back to summary |
|---|---|
| private final ByteBuffer buffer | |
| stream | back to summary |
|---|---|
| private final MessageInputStream stream | |
| utf8Decoder | back to summary |
|---|---|
| private final CharsetDecoder utf8Decoder | |
| MessageReader | back to summary |
|---|---|
| public MessageReader(CoreSession coreSession) | |
| accept | back to summary |
|---|---|
| public void accept(Frame frame, Callback callback) Implements org. Doc from org. Consumes the WebSocket frame, possibly asynchronously when this method has returned. The callback argument must be completed when the frame payload is consumed. The demand for more frames must be explicitly invoked,
or arranged to be invoked asynchronously, by the implementation
of this method, by calling | |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements abstract java. Implements java. Doc from java. Closes the stream and releases any system resources associated with it. Once the stream has been closed, further read(), ready(), mark(), reset(), or skip() invocations will throw an IOException. Closing a previously closed stream has no effect.
| |
| fail | back to summary |
|---|---|
| public void fail(Throwable failure) Overrides default org. Doc from org. Fails this | |
| read | back to summary |
|---|---|
| public int read(char[] chars, int off, int len) throws IOException Implements abstract java. Doc from java. Reads characters into a portion of an array. This method will block until some input is available, an I/O error occurs, or the end of the stream is reached. If
| |