public static <MSG extends Message> CloseableIterator<MSG> readGzipStream(File file, Parser<MSG> parser) {
    try {
      // the input stream is closed by the CloseableIterator
      InputStream input = new GZIPInputStream(new BufferedInputStream(new FileInputStream(file)));
      return readStream(input, parser);
    } catch (Exception e) {
      throw ContextException.of("Unable to read messages", e).addContext("file", file);
    }
  }
@Test
  public void read_gzip_stream() throws IOException {
    File file = temp.newFile();

    Fake item1 = Fake.newBuilder().setLabel("one").setLine(1).build();
    Fake item2 = Fake.newBuilder().setLabel("two").setLine(2).build();

    try (OutputStream os = new GZIPOutputStream(new FileOutputStream(file))) {
      item1.writeDelimitedTo(os);
      item2.writeDelimitedTo(os);
    }

    Iterable<Fake> it = () -> Protobuf.readGzipStream(file, Fake.parser());

    assertThat(it).containsExactly(item1, item2);
  }