code: private static InputStream createFreeOnCloseInputStream(final Blob blob, final InputStream is) {
          return new InputStream() {
  
              @Override
              public int read() throws IOException {
                  return is.read();
              }
  
              @Override
              public void close() throws IOException {
                  try {
                      is.close();
                  } finally {
                      try {
                          blob.free();
                      } catch (SQLException e) {
                          log.debug(e.getMessage());
                      }
                  }
              }
          };
      }
docs: Automatically frees the blob (<code>blob.free()</code>) once the blob
  {@link InputStream} is closed.
  
  @param blob
  @param is
  @return