WsInputStream (Apache Tomcat 7.0.104 API Documentation)

org.apache.catalina.websocket

## Class WsInputStream

- java.lang.Object
- - java.io.InputStream
  - - org.apache.catalina.websocket.WsInputStream

- All Implemented Interfaces:
    Closeable, AutoCloseable

  Deprecated.
  Replaced by the JSR356 WebSocket 1.1 implementation and will be removed in Tomcat 8.0.x.

      @Deprecated
      public class WsInputStream
      extends InputStream

  This class is used to read WebSocket frames from the underlying socket and makes the payload available for reading as an `InputStream`. It only makes the number of bytes declared in the payload length available for reading even if more bytes are available from the socket.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `WsInputStream(UpgradeProcessor<?> processor, WsOutbound outbound)` Deprecated.

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `WsFrame` | `nextFrame(boolean block)` Deprecated. Process the next WebSocket frame.
    `int` | `read()` Deprecated.
    `int` | `read(byte[] b, int off, int len)` Deprecated.

    - ### Methods inherited from class java.io.InputStream

      `available, close, mark, markSupported, read, reset, skip`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### WsInputStream

          public WsInputStream(UpgradeProcessor<?> processor,
                       WsOutbound outbound)

      Deprecated.

  - ### Method Detail

    - #### nextFrame

          public WsFrame nextFrame(boolean block)
                            throws IOException

      Deprecated.
      Process the next WebSocket frame.
      Parameters:
        `block` - Should this method block until a frame is presented if no data is currently available to process. Note that if a single byte is available, this method will block until the complete frame (excluding payload for non-control frames) is available.
      Returns:
        The next frame to be processed or `null` if block is `false` and there is no data to be processed.
      Throws:
        `IOException` - If a problem occurs reading the data for the frame.

    - #### read

          public int read()
                   throws IOException

      Deprecated.
      Specified by:
        `read` in class `InputStream`
      Throws:
        `IOException`

    - #### read

          public int read(byte[] b,
                 int off,
                 int len)
                   throws IOException

      Deprecated.
      Overrides:
        `read` in class `InputStream`
      Throws:
        `IOException`

Copyright © 2000-2020 Apache Software Foundation. All Rights Reserved.