code: private void copydata(InputStream in, OutputStream out) throws java.io.IOException
      {
          long timestamp= 0;
          long byteCount = 0;
          while (true)
          {
              try
              {
                  byteCount = copyBytes(in, out,-1);
                  timestamp= 0;
                  if (byteCount == -1) {
                      return;
                  }
              }
              catch (InterruptedIOException e)
              {
                  LogSupport.ignore(log, e);
                  if (timestamp == 0)
                      timestamp= System.currentTimeMillis();
                  else if (_timeoutMs > 0 && (System.currentTimeMillis() - timestamp) > _timeoutMs)
                      throw e;
              }
          }
      }
docs: /* ------------------------------------------------------------