code: public static void streamInterleaved(final Readable readable, final PairedEndListener listener) throws IOException {
          checkNotNull(readable);
          checkNotNull(listener);
  
          StreamListener streamListener = new StreamListener() {
                  private Fastq left;
  
                  @Override
                  public void fastq(final Fastq fastq) {
                      if (isLeft(fastq) && (left == null)) {
                          left = fastq;
                      }
                      else if (isRight(fastq) && (left != null) && (prefix(left).equals(prefix(fastq)))) {
                          Fastq right = fastq;
                          listener.paired(left, right);
                          left = null;
                      }
                      else {
                          throw new PairedEndFastqReaderException("invalid interleaved FASTQ format, left=" + (left == null ? "null" : left.getDescription()) + " right=" + (fastq == null ? "null" : fastq.getDescription()));
                      }
                  }
              };
  
          try {
              new SangerFastqReader().stream(readable, streamListener);
          }
          catch (PairedEndFastqReaderException e) {
              throw new IOException("could not stream interleaved paired end FASTQ reads", e);
          }
      }
docs: Stream the specified interleaved paired end reads.  Per the interleaved format, all reads must be sorted and paired.
  
  @param readable readable, must not be null
  @param listener paired end listener, must not be null
  @throws IOException if an I/O error occurs