use of okio.GzipSink in project okhttp by square.
the class HttpOverHttp2Test method gzip.
public Buffer gzip(String bytes) throws IOException {
Buffer bytesOut = new Buffer();
BufferedSink sink = Okio.buffer(new GzipSink(bytesOut));
sink.writeUtf8(bytes);
sink.close();
return bytesOut;
}
use of okio.GzipSink in project okhttp by square.
the class Http2Test method gzip.
private static Buffer gzip(byte[] data) throws IOException {
Buffer buffer = new Buffer();
Okio.buffer(new GzipSink(buffer)).write(data).close();
return buffer;
}
use of okio.GzipSink in project okhttp by square.
the class URLConnectionTest method gzip.
/** Returns a gzipped copy of {@code bytes}. */
public Buffer gzip(String data) throws IOException {
Buffer result = new Buffer();
BufferedSink gzipSink = Okio.buffer(new GzipSink(result));
gzipSink.writeUtf8(data);
gzipSink.close();
return result;
}
use of okio.GzipSink in project okhttp by square.
the class CallTest method gzip.
private Buffer gzip(String data) throws IOException {
Buffer result = new Buffer();
BufferedSink sink = Okio.buffer(new GzipSink(result));
sink.writeUtf8(data);
sink.close();
return result;
}
use of okio.GzipSink in project okhttp by square.
the class UrlConnectionCacheTest method gzip.
/** Returns a gzipped copy of {@code bytes}. */
public Buffer gzip(String data) throws IOException {
Buffer result = new Buffer();
BufferedSink sink = Okio.buffer(new GzipSink(result));
sink.writeUtf8(data);
sink.close();
return result;
}
Aggregations