code: private IOException checkRequest(long numBytes, boolean async) {
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
              Tr.entry(tc, "checkRequest");
          }
          IOException exception = null;
          if (TraceComponent.isAnyTracingEnabled() && tc.isDebugEnabled()) {
              Tr.debug(tc, "numBytes=" + numBytes + " jitsize=" + getJITAllocateSize()
                           + " buffers=" + SSLUtils.getBufferTraceInfo(getBuffers()));
          }
  
          // Extract the buffers provided by the calling channel.
          WsByteBuffer callerBuffers[] = getBuffers();
          if (callerBuffers == null || callerBuffers.length == 0) {
              // Found null caller buffers. Check allocation size set by caller.
              if (getJITAllocateSize() <= 0 || getJITAllocateSize() < numBytes) {
                  exception = new IOException("No buffer(s) provided for reading data into.");
              }
          } else if (numBytes == 0) {
              // zero byte read is allowed for sync only
              if (async) {
                  // Can't do a read of zero in async mode.
                  exception = new IOException("Number of bytes requested, "
                                              + numBytes + " is less than minimum allowed (async).");
              }
          } else if (numBytes < 0) {
              // NumBytes requested must be zero or positive
              exception = new IOException("Number of bytes requested, " + numBytes
                                          + " is less than minimum allowed.");
          } else {
              // Ensure buffer provided by caller is big enough to contain the
              // number of bytes requested.
              int bytesAvail = SSLUtils.lengthOf(callerBuffers, 0);
              if (bytesAvail < numBytes) {
                  exception = new IOException("Number of bytes requested, " + numBytes
                                              + " exceeds space remaining in the buffers provided: " + bytesAvail);
              }
          }
  
          if (TraceComponent.isAnyTracingEnabled() && tc.isEntryEnabled()) {
              Tr.exit(tc, "checkRequest: " + exception);
          }
          return exception;
      }
docs: Check the status of the buffers set by the caller taking into account
  the JITAllocation size if the buffers are null or verifying there is
  space available in the the buffers based on the size of data requested.
  
  @param numBytes
  @param async
  @return IOException if an inconsistency/error is found in the request,
  null otherwise.