@Override
  public synchronized int available() throws IOException {
    return (int) Math.max(contentLength - readSoFar, in.available());
 }
Uses the content length as the basis for the return value of {@link #available()} and verifies
that at least content length bytes are returned from the various read methods.
core/src/main/java/com/bumptech/glide/util/ContentLengthInputStream.java