Home | History | Annotate | Download | only in okio

Lines Matching defs:source

24  * A source that uses <a href="http://www.ietf.org/rfc/rfc1952.txt">GZIP</a> to
25 * decompress data read from another source.
27 public final class GzipSource implements Source {
42 * Our source should yield a GZIP header (which we consume directly), followed
46 private final BufferedSource source;
52 * The inflater source takes care of moving data between compressed source and
60 public GzipSource(Source source) {
61 if (source == null) throw new IllegalArgumentException("source == null");
63 this.source = Okio.buffer(source);
64 this.inflaterSource = new InflaterSource(this.source, inflater);
96 // source returns -1. Here we attempt to force the underlying stream to
99 if (!source.exhausted()) {
100 throw new IOException("gzip finished without exhausting source");
114 source.require(10);
115 byte flags = source.buffer().getByte(3);
117 if (fhcrc) updateCrc(source.buffer(), 0, 10);
119 short id1id2 = source.readShort();
121 source.skip(8);
128 source.require(2);
129 if (fhcrc) updateCrc(source.buffer(), 0, 2);
130 int xlen = source.buffer().readShortLe();
131 source.require(xlen);
132 if (fhcrc) updateCrc(source.buffer(), 0, xlen);
133 source.skip(xlen);
141 long index = source.indexOf((byte) 0);
143 if (fhcrc) updateCrc(source.buffer(), 0, index + 1);
144 source.skip(index + 1);
152 long index = source.indexOf((byte) 0);
154 if (fhcrc) updateCrc(source.buffer(), 0, index + 1);
155 source.skip(index + 1);
163 checkEqual("FHCRC", source.readShortLe(), (short) crc.getValue());
173 checkEqual("CRC", source.readIntLe(), (int) crc.getValue());
174 checkEqual("ISIZE", source.readIntLe(), inflater.getTotalOut());
178 return source.timeout();