Class MessageReader
java.lang.Object
java.io.Reader
org.eclipse.jetty.websocket.core.internal.messages.MessageReader
- All Implemented Interfaces:
Closeable
,AutoCloseable
,Readable
,MessageSink
Support class for reading a (single) WebSocket TEXT message via a Reader.
In compliance to the WebSocket spec, this reader always uses the StandardCharsets.UTF_8
.
-
Field Summary
-
Constructor Summary
-
Method Summary
Methods inherited from class java.io.Reader
mark, markSupported, nullReader, read, read, read, ready, reset, skip, transferTo
-
Constructor Details
-
MessageReader
public MessageReader() -
MessageReader
public MessageReader(int bufferSize)
-
-
Method Details
-
read
- Specified by:
read
in classReader
- Throws:
IOException
-
close
- Specified by:
close
in interfaceAutoCloseable
- Specified by:
close
in interfaceCloseable
- Specified by:
close
in classReader
- Throws:
IOException
-
fail
Description copied from interface:MessageSink
Fail the message sink.
Release any resources and fail all stored callbacks as
MessageSink.accept(Frame, Callback)
will never be called again.- Specified by:
fail
in interfaceMessageSink
- Parameters:
failure
- the failure that occurred.
-
accept
Description copied from interface:MessageSink
Consume the frame payload to the message.- Specified by:
accept
in interfaceMessageSink
- Parameters:
frame
- the frame, its payload (and fin state) to appendcallback
- the callback for how the frame was consumed
-