Home | History | Annotate | Download | only in okio

Lines Matching defs:inflater

21 import java.util.zip.Inflater;
29 private final Inflater inflater;
32 * When we call Inflater.setInput(), the inflater keeps our byte array until
33 * it needs input again. This tracks how many bytes the inflater is currently
39 public InflaterSource(Source source, Inflater inflater) {
40 this(Okio.buffer(source), inflater);
45 * In general we can't share a BufferedSource because the inflater holds input
48 InflaterSource(BufferedSource source, Inflater inflater) {
50 if (inflater == null) throw new IllegalArgumentException("inflater == null");
52 this.inflater = inflater;
64 // Decompress the inflater's compressed data into the sink.
67 int bytesInflated = inflater.inflate(tail.data, tail.limit, Segment.SIZE - tail.limit);
73 if (inflater.finished() || inflater.needsDictionary()) {
90 * Refills the inflater with compressed data if it needs input. (And only if
91 * it needs input). Returns true if the inflater required input but the source
95 if (!inflater.needsInput()) return false;
98 if (inflater.getRemaining() != 0) throw new IllegalStateException("?"); // TODO: possible?
100 // If there are compressed bytes in the source, assign them to the inflater.
103 // Assign buffer bytes to the inflater.
106 inflater.setInput(head.data, head.pos, bufferBytesHeldByInflater);
110 /** When the inflater has processed compressed data, remove it from the buffer. */
113 int toRelease = bufferBytesHeldByInflater - inflater.getRemaining();
124 inflater.end();