Package com.yahoo.compress
Class ArchiveStreamReader
java.lang.Object
com.yahoo.compress.ArchiveStreamReader
- All Implemented Interfaces:
AutoCloseable
Helper class for safely reading files from a compressed archive.
- Author:
- mpolden
-
Nested Class Summary
Modifier and TypeClassDescriptionstatic class
Information about a file extracted from a compressed archivestatic class
Options for reading entries of an archive -
Method Summary
Modifier and TypeMethodDescriptionvoid
close()
static ArchiveStreamReader
ofTarGzip
(InputStream inputStream, ArchiveStreamReader.Options options) Create reader for an inputStream containing a tar.gz filestatic ArchiveStreamReader
ofZip
(InputStream inputStream, ArchiveStreamReader.Options options) Create reader for an inputStream containing a ZIP filereadNextTo
(OutputStream outputStream) Read the next file in this archive and write it to given outputStream.
-
Method Details
-
ofTarGzip
public static ArchiveStreamReader ofTarGzip(InputStream inputStream, ArchiveStreamReader.Options options) Create reader for an inputStream containing a tar.gz file -
ofZip
public static ArchiveStreamReader ofZip(InputStream inputStream, ArchiveStreamReader.Options options) Create reader for an inputStream containing a ZIP file -
readNextTo
Read the next file in this archive and write it to given outputStream. Returns information about the read archive file, or null if there are no more files to read. -
close
public void close()- Specified by:
close
in interfaceAutoCloseable
-