Code example for SelectableChannel

Methods: configureBlocking

0
   * is zero, it will be treated as infinite timeout. The socket's 
   * channel will be configured to be non-blocking. 
   *  
   * @param channel  
   *        Channel for reading, should also be a {@link SelectableChannel}. 
   *        The channel will be configured to be non-blocking. 
   * @param timeout timeout in milliseconds. must not be negative. 
   * @throws IOException 
   */ 
  public SocketInputStream(ReadableByteChannel channel, long timeout)
                                                        throws IOException { 
    SocketIOWithTimeout.checkChannelValidity(channel);
    reader = new Reader(channel, timeout);
  } 
 
  /** 
   * Same as SocketInputStream(socket.getChannel(), timeout): <br><br> 
   *  
   * Create a new input stream with the given timeout. If the timeout 
   * is zero, it will be treated as infinite timeout. The socket's 
   * channel will be configured to be non-blocking.