public void close() throws IOException {
  if (closed) {
    return;
  }
  if (queuedForCleanup) {
    return;
  }
  try {
    if (expected > count) {
      long nskip=expected - count;
      if (nskip <= available()) {
        do {
        }
 while ((nskip=(expected - count)) > 0L && skip(Math.min(nskip,available())) > 0L);
      }
 else       if (expected <= KeepAliveStreamCleaner.MAX_DATA_REMAINING && !hurried) {
        queueForCleanup(new KeepAliveCleanerEntry(this,hc));
      }
 else {
        hc.closeServer();
      }
    }
    if (!closed && !hurried && !queuedForCleanup) {
      hc.finished();
    }
  }
  finally {
    if (pi != null)     pi.finishTracking();
    if (!queuedForCleanup) {
      in=null;
      hc=null;
      closed=true;
    }
  }
}

public void close ( ) throws IOException { if ( closed ) { return ; } if ( queuedForCleanup ) { return ; } try { if ( expected > count ) { long nskip = expected - count ; if ( nskip <= available ( ) ) { do { } while ( ( nskip = ( expected - count ) ) > 0L && skip ( Math . min ( nskip , available ( ) ) ) > 0L ) ; } else if ( expected <= KeepAliveStreamCleaner . MAX_DATA_REMAINING && ! hurried ) { queueForCleanup ( new KeepAliveCleanerEntry ( this , hc ) ) ; } else { hc . closeServer ( ) ; } } if ( ! closed && ! hurried && ! queuedForCleanup ) { hc . finished ( ) ; } } finally { if ( pi != null ) pi . finishTracking ( ) ; if ( ! queuedForCleanup ) { in = null ; hc = null ; closed = true ; } } }
attempt to cache this connection
