public void read(final InputStream inputStream, final Era1ReaderListener listener)
      throws IOException {
    int blockIndex = 0;
    while (inputStream.available() > 0) {
      Era1Type type = Era1Type.getForTypeCode(inputStream.readNBytes(TYPE_LENGTH));
      int length = (int) convertLittleEndianBytesToLong(inputStream.readNBytes(LENGTH_LENGTH));
      switch (type) {
        case VERSION -> {
          // do nothing
        }
        case EMPTY, ACCUMULATOR, TOTAL_DIFFICULTY -> {
          // skip the bytes that were indicated to be empty
          // TODO read ACCUMULATOR and TOTAL_DIFFICULTY properly?
          inputStream.skipNBytes(length);
        }
        case COMPRESSED_EXECUTION_BLOCK_HEADER -> {
          byte[] compressedExecutionBlockHeader = inputStream.readNBytes(length);
          try (SnappyFramedInputStream decompressionStream =
              snappyFactory.createFramedInputStream(compressedExecutionBlockHeader)) {
            listener.handleExecutionBlockHeader(
                new Era1ExecutionBlockHeader(decompressionStream.readAllBytes(), blockIndex));
          }
        }
        case COMPRESSED_EXECUTION_BLOCK_BODY -> {
          byte[] compressedExecutionBlock = inputStream.readNBytes(length);
          try (SnappyFramedInputStream decompressionStream =
              snappyFactory.createFramedInputStream(compressedExecutionBlock)) {
            listener.handleExecutionBlockBody(
                new Era1ExecutionBlockBody(decompressionStream.readAllBytes(), blockIndex));
          }
        }
        case COMPRESSED_EXECUTION_BLOCK_RECEIPTS -> {
          byte[] compressedReceipts = inputStream.readNBytes(length);
          try (SnappyFramedInputStream decompressionStream =
              snappyFactory.createFramedInputStream(compressedReceipts)) {
            listener.handleExecutionBlockReceipts(
                new Era1ExecutionBlockReceipts(decompressionStream.readAllBytes(), blockIndex++));
          }
        }
        case BLOCK_INDEX -> {
          ByteArrayInputStream blockIndexInputStream =
              new ByteArrayInputStream(inputStream.readNBytes(length));
          long startingBlockIndex =
              convertLittleEndianBytesToLong(
                  blockIndexInputStream.readNBytes(STARTING_BLOCK_INDEX_LENGTH));
          List<Long> indexes = new ArrayList<>();
          while (blockIndexInputStream.available() > BLOCK_INDEX_COUNT_LENGTH) {
            indexes.add(
                convertLittleEndianBytesToLong(
                    blockIndexInputStream.readNBytes(BLOCK_INDEX_LENGTH)));
          }
          long indexCount =
              convertLittleEndianBytesToLong(
                  blockIndexInputStream.readNBytes(BLOCK_INDEX_COUNT_LENGTH));
          if (indexCount != indexes.size()) {
            LOG.warn(
                "index count does not match number of indexes present for InputStream: {}",
                inputStream);
          }
          listener.handleBlockIndex(new Era1BlockIndex(startingBlockIndex, indexes));
        }
      }
    }
  }
Reads the entire supplied InputStream, calling appropriate methods on the supplied
Era1ReaderListener as different parts of the file are read

@param inputStream The InputStream
@param listener the Era1ReaderListener
@throws IOException If there are any problems reading from the InputStream, or creating and
    using other streams, such as a SnappyFramedInputStream
util/src/main/java/org/hyperledger/besu/util/era1/Era1Reader.java