@Override
  public int read(byte[] b, int off, int len) throws IOException {
    final int result = in.read(b, off, len);
    if (result != -1) {
      count += result;
    }
    return result;
  }
Returns the number of bytes read.
micrometer/src/main/java/feign/micrometer/CountingInputStream.java