public class FrameScanner
extends java.lang.Object
InputStream
(which is supposed to be the input stream of a WebSocket
. Each time the
getFrame()
method is called, it tries to create a RawFrame
from bytes that arrived on the input stream.Constructor and Description |
---|
FrameScanner(java.io.InputStream is)
Create a new FrameScanner for the given
InputStream . |
Modifier and Type | Method and Description |
---|---|
RawFrame |
getFrame()
Get a complete frame from the input stream.
|
public FrameScanner(java.io.InputStream is)
InputStream
.is
- the input stream to read from. It is supposed to be the stream of a WebSocket
public RawFrame getFrame() throws java.io.IOException, WebSocketException
IOException
occurs.java.io.IOException
- if an IOException
is encountered by the input streamWebSocketException
- if the frame is invalid.