Class GzipCompressorInputStream.Builder
- All Implemented Interfaces:
IOSupplier<GzipCompressorInputStream>
- Enclosing class:
GzipCompressorInputStream
GzipCompressorInputStream.
For example:
GzipCompressorInputStream s = GzipCompressorInputStream.builder()
.setPath(path)
.setFileNameCharset(StandardCharsets.ISO_8859_1)
.get();
- Since:
- 1.28.0
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionget()Builds a newGzipCompressorInputStream.setDecompressConcatenated(boolean decompressConcatenated) Sets whether we should allow decompressing multiple members.setFileNameCharset(Charset fileNameCharset) Sets the Charset to use for writing file names and comments, where null maps toGzipUtils.GZIP_ENCODING.setOnMemberEnd(IOConsumer<GzipCompressorInputStream> onMemberEnd) Sets the consumer called when a member trailer is parsed.setOnMemberStart(IOConsumer<GzipCompressorInputStream> onMemberStart) Sets the consumer called when a member header is parsed.Methods inherited from class org.apache.commons.io.build.AbstractStreamBuilder
getBufferSize, getBufferSizeDefault, getCharSequence, getCharset, getCharsetDefault, getFile, getInputStream, getOpenOptions, getOutputStream, getPath, getRandomAccessFile, getReader, getWriter, setBufferSize, setBufferSize, setBufferSizeChecker, setBufferSizeDefault, setBufferSizeMax, setCharset, setCharset, setCharsetDefault, setOpenOptionsMethods inherited from class org.apache.commons.io.build.AbstractOriginSupplier
checkOrigin, getOrigin, hasOrigin, newByteArrayOrigin, newCharSequenceOrigin, newFileOrigin, newFileOrigin, newInputStreamOrigin, newOutputStreamOrigin, newPathOrigin, newPathOrigin, newRandomAccessFileOrigin, newRandomAccessFileOrigin, newReaderOrigin, newURIOrigin, newWriterOrigin, setByteArray, setCharSequence, setFile, setFile, setInputStream, setOrigin, setOutputStream, setPath, setPath, setRandomAccessFile, setRandomAccessFile, setReader, setURI, setWriterMethods inherited from class org.apache.commons.io.build.AbstractSupplier
asThisMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.apache.commons.io.function.IOSupplier
asSupplier, getUnchecked
-
Constructor Details
-
Builder
public Builder()Constructs a new builder ofGzipCompressorInputStream.
-
-
Method Details
-
get
Builds a newGzipCompressorInputStream.You must set input that supports
InputStream, otherwise, this method throws an exception.- Returns:
- a new instance.
- Throws:
IllegalStateException- if theoriginisnull.UnsupportedOperationException- if the origin cannot be converted to anInputStream.IOException- See Also:
-
setDecompressConcatenated
Sets whether we should allow decompressing multiple members.- Parameters:
decompressConcatenated- whether we should allow decompressing multiple members.- Returns:
- this instance.
-
setFileNameCharset
Sets the Charset to use for writing file names and comments, where null maps toGzipUtils.GZIP_ENCODING.Setting a value other than
GzipUtils.GZIP_ENCODINGis not compliant with the RFC 1952 GZIP File Format Specification. Use at your own risk of interoperability issues.The default value is
GzipUtils.GZIP_ENCODING.- Parameters:
fileNameCharset- the Charset to use for writing file names and comments, null maps toGzipUtils.GZIP_ENCODING.- Returns:
- this instance.
-
setOnMemberEnd
public GzipCompressorInputStream.Builder setOnMemberEnd(IOConsumer<GzipCompressorInputStream> onMemberEnd) Sets the consumer called when a member trailer is parsed.When a member header is parsed, all
GzipParametersvalues are initialized excepttrailerCrcandtrailerISize.When a member trailer is parsed, the
GzipParametersvaluestrailerCrcandtrailerISizeare set.- Parameters:
onMemberEnd- The consumer.- Returns:
- this instance.
- See Also:
-
setOnMemberStart
public GzipCompressorInputStream.Builder setOnMemberStart(IOConsumer<GzipCompressorInputStream> onMemberStart) Sets the consumer called when a member header is parsed.When a member header is parsed, all
GzipParametersvalues are initialized excepttrailerCrcandtrailerISize.When a member trailer is parsed, the
GzipParametersvaluestrailerCrcandtrailerISizeare set.- Parameters:
onMemberStart- The consumer.- Returns:
- this instance.
- See Also:
-