Package org.apache.commons.compress.archivers.examples

# Interface CloseableConsumer

public interface CloseableConsumer
Callback that is informed about a closable resource that has been wrapped around a passed in stream or channel by Expander or Archiver when Expander or Archiver no longer need them.

This provides a way to close said resources in the calling code.

Since:
  1.19

- ## Field Summary

  Fields
  Modifier and Type
  Field
  Description
  `static final CloseableConsumer`
  `CLOSING_CONSUMER`
  Closes the passed in Closeable immediately.
  `static final CloseableConsumer`
  `NULL_CONSUMER`
  Ignores the passed in Closeable.

- ## Method Summary

  Modifier and Type
  Method
  Description
  `void`
  `accept(Closeable c)`
  Callback that is informed about a Closeable resource that has been wrapped around a passed in stream or channel by Expander or Archiver when Expander or Archiver no longer need them.

- ## Field Details

  - ### CLOSING_CONSUMER

    static final CloseableConsumer CLOSING_CONSUMER
    Closes the passed in Closeable immediately.

  - ### NULL_CONSUMER

    static final CloseableConsumer NULL_CONSUMER
    Ignores the passed in Closeable.

- ## Method Details

  - ### accept

    void accept(Closeable c) throws IOException
    Callback that is informed about a Closeable resource that has been wrapped around a passed in stream or channel by Expander or Archiver when Expander or Archiver no longer need them.
    Parameters:
      `c` - Closeable created by Expander or Archiver that is now no longer used
    Throws:
      `IOException` - on error