src/java.base/share/classes/sun/security/ssl/SSLSocketInputRecord.java
changeset 53067 8a61a04c456c
parent 51407 910f7b56592f
child 55353 946f7f2d321c
child 58678 9cf78a70fa4f
equal deleted inserted replaced
53066:a7bd89486175 53067:8a61a04c456c
   461             n += readLen;
   461             n += readLen;
   462         }
   462         }
   463 
   463 
   464         return n;
   464         return n;
   465     }
   465     }
       
   466 
       
   467     // Try to use up the input stream without impact the performance too much.
       
   468     void deplete(boolean tryToRead) throws IOException {
       
   469         int remaining = is.available();
       
   470         if (tryToRead && (remaining == 0)) {
       
   471             // try to wait and read one byte if no buffered input
       
   472             is.read();
       
   473         }
       
   474 
       
   475         while ((remaining = is.available()) != 0) {
       
   476             is.skip(remaining);
       
   477         }
       
   478     }
   466 }
   479 }