private boolean doRead ( int amountToRead ) throws IOException { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "doRead, Current buffer, " + _buffer + ", reading from the TCP Channel, readLine : " + _isReadLine ) ; } try { if ( _tcpChannelCallback != null && ! _isReadLine ) { //async read logic return immediateRead ( amountToRead ) ; } else { return syncRead ( amountToRead ) ; } } catch ( IOException e ) { if ( TraceComponent . isAnyTracingEnabled ( ) && tc . isDebugEnabled ( ) ) { Tr . debug ( tc , "doRead, we encountered an exception during the read : " + e ) ; } if ( _error != null ) { return false ; } _error = e ; throw e ; } }
This method will call the synchronous or asynchronous method depending on how everything is set up