docs: private boolean readable(final int minimum) throws IOException
      {
          int existing = limit - offset;
          final int available = buffer.length - limit;
  
          if (minimum > available + existing)
          {
              // move to front.
              System.arraycopy(buffer, offset, buffer, 0, existing);
              offset = 0;
              limit = existing;
  
              int read;
              do
              {
                  read = in.read(buffer, limit, buffer.length - limit);
                  if (read == -1)
                      return false;
  
                  limit += read;
                  existing += read;
              } while (existing < minimum);
  
              return true;
          }
  
          int read;
          do
          {
              read = in.read(buffer, limit, buffer.length - limit);
              if (read == -1)
                  return false;
  
              limit += read;
              existing += read;
          } while (existing < minimum);
  
          return true;
      }