content: package okhttp3.internal.ws;
  
  import java.io.Closeable;
  import java.io.IOException;
  import java.util.zip.Inflater;
  import kotlin.Metadata;
  import kotlin.jvm.internal.Intrinsics;
  import okio.Buffer;
  import okio.InflaterSource;
  import okio.Source;
  
  @Metadata(bv = {1, 0, 3}, d1 = {"\u0000,\n\u0002\u0018\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u000b\n\u0002\b\u0002\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0018\u0002\n\u0000\n\u0002\u0010\u0002\n\u0002\b\u0003\u0018\u00002\u00020\u0001B\r\u0012\u0006\u0010\u0002\u001a\u00020\u0003¢\u0006\u0002\u0010\u0004J\b\u0010\u000b\u001a\u00020\fH\u0016J\u000e\u0010\r\u001a\u00020\f2\u0006\u0010\u000e\u001a\u00020\u0006R\u000e\u0010\u0005\u001a\u00020\u0006X\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0007\u001a\u00020\bX\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\t\u001a\u00020\nX\u0004¢\u0006\u0002\n\u0000R\u000e\u0010\u0002\u001a\u00020\u0003X\u0004¢\u0006\u0002\n\u0000¨\u0006\u000f"}, d2 = {"Lokhttp3/internal/ws/MessageInflater;", "Ljava/io/Closeable;", "noContextTakeover", "", "(Z)V", "deflatedBytes", "Lokio/Buffer;", "inflater", "Ljava/util/zip/Inflater;", "inflaterSource", "Lokio/InflaterSource;", "close", "", "inflate", "buffer", "okhttp"}, k = 1, mv = {1, 4, 0})
  /* compiled from: MessageInflater.kt */
  public final class MessageInflater implements Closeable {
      private final Buffer deflatedBytes;
      private final Inflater inflater;
      private final InflaterSource inflaterSource;
      private final boolean noContextTakeover;
  
      public MessageInflater(boolean noContextTakeover2) {
          this.noContextTakeover = noContextTakeover2;
          Buffer buffer = new Buffer();
          this.deflatedBytes = buffer;
          Inflater inflater2 = new Inflater(true);
          this.inflater = inflater2;
          this.inflaterSource = new InflaterSource((Source) buffer, inflater2);
      }
  
      public void close() throws IOException {
          this.inflaterSource.close();
      }
  
      public final void inflate(Buffer buffer) throws IOException {
          Intrinsics.checkNotNullParameter(buffer, "buffer");
          if (this.deflatedBytes.size() == 0) {
              if (this.noContextTakeover) {
                  this.inflater.reset();
              }
              this.deflatedBytes.writeAll(buffer);
              this.deflatedBytes.writeInt(65535);
              long bytesRead = this.inflater.getBytesRead() + this.deflatedBytes.size();
              do {
                  this.inflaterSource.readOrInflate(buffer, Long.MAX_VALUE);
              } while (this.inflater.getBytesRead() < bytesRead);
              return;
          }
          throw new IllegalArgumentException("Failed requirement.".toString());
      }
  }
  