public TemporaryResourceInMemory(final InputStream source) throws IOException {

    try {
      this.data = IoUtils.toByteArray(source);
    } catch (final IOException e) {
      this.close();
      throw e;
    } finally {
      IoUtils.closeQuietly(source);
    }
  }
  public TemporaryResourceInMemory(final InStreamSource source) throws IOException {

    try (InputStream sourceStream = source.getInputStream()) {
      this.data = IoUtils.toByteArray(sourceStream);
    } catch (final IOException e) {
      this.close();
      throw e;
    }
  }