53 lines
1.5 KiB
Java
53 lines
1.5 KiB
Java
|
package io.grpc;
|
||
|
|
||
|
import java.io.IOException;
|
||
|
import java.io.InputStream;
|
||
|
import java.io.OutputStream;
|
||
|
import java.util.zip.GZIPInputStream;
|
||
|
import java.util.zip.GZIPOutputStream;
|
||
|
|
||
|
/* loaded from: classes6.dex */
|
||
|
public interface Codec extends Compressor, Decompressor {
|
||
|
|
||
|
/* loaded from: classes6.dex */
|
||
|
public static final class Gzip implements Codec {
|
||
|
@Override // io.grpc.Compressor
|
||
|
public final OutputStream compress(OutputStream outputStream) throws IOException {
|
||
|
return new GZIPOutputStream(outputStream);
|
||
|
}
|
||
|
|
||
|
@Override // io.grpc.Decompressor
|
||
|
public final InputStream decompress(InputStream inputStream) throws IOException {
|
||
|
return new GZIPInputStream(inputStream);
|
||
|
}
|
||
|
|
||
|
@Override // io.grpc.Compressor, io.grpc.Decompressor
|
||
|
public final String getMessageEncoding() {
|
||
|
return "gzip";
|
||
|
}
|
||
|
}
|
||
|
|
||
|
/* loaded from: classes6.dex */
|
||
|
public static final class Identity implements Codec {
|
||
|
public static final Codec NONE = new Identity();
|
||
|
|
||
|
@Override // io.grpc.Compressor
|
||
|
public final OutputStream compress(OutputStream outputStream) {
|
||
|
return outputStream;
|
||
|
}
|
||
|
|
||
|
@Override // io.grpc.Decompressor
|
||
|
public final InputStream decompress(InputStream inputStream) {
|
||
|
return inputStream;
|
||
|
}
|
||
|
|
||
|
private Identity() {
|
||
|
}
|
||
|
|
||
|
@Override // io.grpc.Compressor, io.grpc.Decompressor
|
||
|
public final String getMessageEncoding() {
|
||
|
return "identity";
|
||
|
}
|
||
|
}
|
||
|
}
|