public boolean isReady(){
        
        //If there is no ReadListener set we never know if we can read without blocking
        if(_rl == null) {
            return true;
        }
        
        long bytesRead = 0;
        
        //We will check here if the buffer has anything in it.
        //If so we will return immediately. The only time this should ever happen is after we read the first byte
        //of data from a new connection
        //If not then we will read immediately for 1 byte
        if(_buffer != null && _buffer.hasRemaining()){
            //This must have been an initial read, so return true that we have one byte of data
            _isReady = true;
            return _isReady;
        } else {
            //We only want to read for 1 byte so we aren't buffering much data
            //We will preserve this byte on the async read and return it back to the customer when necessary
            try {
                setAndAllocateBuffer(1);
                
                //Immediately read for some data. This will return immediately if there was anything
                bytesRead = _tcpContext.getReadInterface().read(0, WCCustomProperties31.UPGRADE_READ_TIMEOUT);
                
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()){
                    Tr.debug(tc, "isReady, Completed the read, " + bytesRead);
                }
                //If there was one byte read, then great. Get it and return true that we have some data
                if(bytesRead == 1){
                    //Get the buffer from the TCP Channel after we have told them to read.
                    _buffer = _tcpContext.getReadInterface().getBuffer(); 
                    
                    //We don't need to check for null first as we know we will always get the buffer we just set
                    configurePostReadBuffer();
                    
                    _isReady = true;
                    return _isReady;
                } else {
                    //We only ever expect to read 1 byte here if we read more then something went wrong
                    if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()){
                        Tr.debug(tc, "isReady, Read some amount of data other than one byte on the read : " + bytesRead);
                    }
                    
                    _buffer.release();
                    _buffer = null;
                }
            } catch (IOException ioe){
                if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()){
                    Tr.debug(tc, "isReady, An exception happened during the check of isReady : " + ioe + ", returning false");
                }
            }
        }
        
        _isReady = false;
        return _isReady;
    }
public boolean isReady ( ) { if ( _rl == null ) { return true ; } long bytesRead = 0 ; if ( _buffer != null && _buffer . hasRemaining ( ) ) { _isReady = true ; return _isReady ; } else { try { setAndAllocateBuffer ( 1 ) ; bytesRead = _tcpContext . getReadInterface ( ) . read ( 0 , WCCustomProperties31 . UPGRADE_READ_TIMEOUT ) ; if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "isReady, Completed the read, " + bytesRead ) ; } if ( bytesRead == 1 ) { _buffer = _tcpContext . getReadInterface ( ) . getBuffer ( ) ; configurePostReadBuffer ( ) ; _isReady = true ; return _isReady ; } else { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "isReady, Read some amount of data other than one byte on the read : " + bytesRead ) ; } _buffer . release ( ) ; _buffer = null ; } } catch ( IOException ioe ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "isReady, An exception happened during the check of isReady : " + ioe + ", returning false" ) ; } } } _isReady = false ; return _isReady ; }
This method will check if the stream can be read from without blocking.
We accomplish this by looking at the buffer, and if it's not null and has remaining(which it will if we are returning from the initial read),
then we will return true. If those conditions aren't true then we will issue a read for 1 byte.
This read checks if the stream is viable or not by immediately reading for one byte. If it is then it configures that buffer
and then returns true.

@return isReady - a boolean to indicate if the stream can be read from without blocking