# ArchiveStreamProvider (Apache Commons Compress 1.13 API)

org.apache.commons.compress.archivers

## Interface ArchiveStreamProvider

- All Known Implementing Classes:
    ArchiveStreamFactory

      public interface ArchiveStreamProvider

  Creates Archive `ArchiveInputStream`s and `ArchiveOutputStream`s.
  Since:
    1.13

- - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `ArchiveInputStream` | `createArchiveInputStream(String name, InputStream in, String encoding)` Creates an archive input stream from an archiver name and an input stream.
    `ArchiveOutputStream` | `createArchiveOutputStream(String name, OutputStream out, String encoding)` Creates an archive output stream from an archiver name and an output stream.
    `Set<String>` | `getInputStreamArchiveNames()` Gets all the input stream archive names for this provider
    `Set<String>` | `getOutputStreamArchiveNames()` Gets all the output stream archive names for this provider

- - ### Method Detail

    - #### createArchiveInputStream

          ArchiveInputStream createArchiveInputStream(String name,
                                                    InputStream in,
                                                    String encoding)
                                                      throws ArchiveException

      Creates an archive input stream from an archiver name and an input stream.
      Parameters:
        `name` - the archive name, i.e. "ar", "arj", "zip", "tar", "jar", "cpio", "dump" or "7z"
        `in` - the input stream
        `encoding` - encoding name or null for the default
      Returns:
        the archive input stream
      Throws:
        `ArchiveException` - if the archiver name is not known
        `StreamingNotSupportedException` - if the format cannot be read from a stream
        `IllegalArgumentException` - if the archiver name or stream is null

    - #### createArchiveOutputStream

          ArchiveOutputStream createArchiveOutputStream(String name,
                                                      OutputStream out,
                                                      String encoding)
                                                        throws ArchiveException

      Creates an archive output stream from an archiver name and an output stream.
      Parameters:
        `name` - the archive name, i.e. "ar", "zip", "tar", "jar" or "cpio"
        `out` - the output stream
        `encoding` - encoding name or null for the default
      Returns:
        the archive output stream
      Throws:
        `ArchiveException` - if the archiver name is not known
        `StreamingNotSupportedException` - if the format cannot be written to a stream
        `IllegalArgumentException` - if the archiver name or stream is null

    - #### getInputStreamArchiveNames

          Set<String> getInputStreamArchiveNames()

      Gets all the input stream archive names for this provider
      Returns:
        all the input archive names for this provider

    - #### getOutputStreamArchiveNames

          Set<String> getOutputStreamArchiveNames()

      Gets all the output stream archive names for this provider
      Returns:
        all the output archive names for this provider

Copyright © 2016 The Apache Software Foundation. All rights reserved.