public class GunzipByteSource extends Object implements ByteSource
Constructor and Description |
---|
GunzipByteSource(ByteSource origin)
Create a GunzipByteSource that decompresses the `origin` source in gzip format.
|
public GunzipByteSource(ByteSource origin)
public Async<ByteBuffer> read() throws IllegalStateException
If the origin source is not in valid gzip format, the read() action fails with
ZipException
.
read
in interface ByteSource
IllegalStateException
public Async<Void> close()
ByteSource
This method can be called multiple times; only the first call is effective.
This method should not be invoked while a read() is pending;
if that's needed, see ThreadSafeByteSource
for a solution.
Since ByteSource is a read-only concept, close() should not have any
side effects that the caller cares about.
The caller is allowed to ignore the returned Async<Void>
(as if the method returns void
).
The close() action should not fail; if some internal exception arises, it can be logged.
Most implementations return an immediate Async.VOID
,
even if there are still background cleanup tasks running.
close
in interface ByteSource