Modifier and Type | Field and Description |
---|---|
private int |
bufferBytesHeldByInflater
When we call Inflater.setInput(), the inflater keeps our byte array until
it needs input again.
|
private boolean |
closed |
private java.util.zip.Inflater |
inflater |
private BufferedSource |
source |
Constructor and Description |
---|
InflaterSource(BufferedSource source,
java.util.zip.Inflater inflater)
This package-private constructor shares a buffer with its trusted caller.
|
InflaterSource(Source source,
java.util.zip.Inflater inflater) |
Modifier and Type | Method and Description |
---|---|
void |
close()
Closes this source and releases the resources held by this source.
|
long |
read(Buffer sink,
long byteCount)
Removes at least 1, and up to
byteCount bytes from this and appends
them to sink . |
boolean |
refill()
Refills the inflater with compressed data if it needs input.
|
private void |
releaseInflatedBytes()
When the inflater has processed compressed data, remove it from the buffer.
|
Timeout |
timeout()
Returns the timeout for this source.
|
private final BufferedSource source
private final java.util.zip.Inflater inflater
private int bufferBytesHeldByInflater
private boolean closed
public InflaterSource(Source source, java.util.zip.Inflater inflater)
InflaterSource(BufferedSource source, java.util.zip.Inflater inflater)
public long read(Buffer sink, long byteCount) throws java.io.IOException
Source
byteCount
bytes from this and appends
them to sink
. Returns the number of bytes read, or -1 if this
source is exhausted.public final boolean refill() throws java.io.IOException
java.io.IOException
private void releaseInflatedBytes() throws java.io.IOException
java.io.IOException
public Timeout timeout()
Source
public void close() throws java.io.IOException
Source