docs: @Override
      public long contentLength() throws IOException {
          InputStream is = this.getInputStream();
          Assert.state(is != null, "resource input stream must not be null");
          try {
              long size = 0;
              byte[] buf = new byte[255];
              int read;
              while ((read = is.read(buf)) != -1) {
                  size += read;
              }
              return size;
          } finally {
              try {
                  is.close();
              } catch (IOException ex) {
              }
          }
      }