private WebSocketInputStream openInputStream(Socket socket) throws WebSocketException {
  try {
    return new WebSocketInputStream(new BufferedInputStream(socket.getInputStream()));
  }
 catch (  IOException e) {
    throw new WebSocketException(WebSocketError.SOCKET_INPUT_STREAM_FAILURE,"Failed to get the input stream of the raw socket: " + e.getMessage(),e);
  }
}

private WebSocketInputStream openInputStream ( Socket socket ) throws WebSocketException { try { return new WebSocketInputStream ( new BufferedInputStream ( socket . getInputStream ( ) ) ) ; } catch ( IOException e ) { throw new WebSocketException ( WebSocketError . SOCKET_INPUT_STREAM_FAILURE , "Failed to get the input stream of the raw socket: " + e . getMessage ( ) , e ) ; } }
open the input stream of the websocket connection . the stream is used by the reading thread .
