package util.sqlparse.visitor.mysql.test;

import java.io.ByteArrayOutputStream;
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.util.Iterator;

public class SqlCollection implements Iterator<String> {
   FileInputStream in = null;
   String path;
   String current = null;

   public SqlCollection(String path) {
      this.path = path;
   }

   public void init() throws FileNotFoundException {
      this.in = new FileInputStream(this.path);
   }

   public boolean hasNext() {
      ByteArrayOutputStream output = new ByteArrayOutputStream();
      int c = 0;

      try {
         do {
            c = this.in.read();
            if (c != 10) {
               output.write(c);
            }
         } while(c != 10);

         this.current = new String(output.toByteArray());
         int cc = this.current.charAt(this.current.length() - 1);
         if (cc == 0) {
            this.current = this.current.substring(0, this.current.length() - 1);
         }

         if (this.current.startsWith("2021")) {
            this.current = this.current.substring("2021-11-29T21:14:01.080775+08:00\t2484214 Query".length());
         }

         boolean var4 = true;
         return var4;
      } catch (IOException e) {
         e.printStackTrace();
      } finally {
         try {
            output.close();
         } catch (IOException e) {
            e.printStackTrace();
         }

      }

      return false;
   }

   public String next() {
      return this.current;
   }

   public void remove() {
   }
}
