// Path: src/main/java/br/com/tecsinapse/dataio/converter/Converter.java
// public interface Converter<F, T> {
//     T apply(F input);
//     T apply(String input);
// }
// 
// Path: src/main/java/br/com/tecsinapse/dataio/util/FixedLengthFileUtil.java
// @UtilityClass
// public final class FixedLengthFileUtil {
// 
//     public static List<String> getLines(InputStream inputStream, boolean ignoreFirstLine, Charset charset) throws IOException {
//         return getLines(inputStream, ignoreFirstLine, 0, null, charset);
//     }
// 
//     private static List<String> getLines(InputStream inputStream, boolean ignoreFirstLine, int afterLine, String eofCharacter, Charset charset) throws IOException {
//         return getLines(inputStream, ignoreFirstLine, afterLine, 0, eofCharacter, charset);
//     }
// 
//     public static List<String> getLines(InputStream inputStream, boolean ignoreFirstLine, int afterLine, int ignoreLastLines, String eofCharacter, Charset charset) throws IOException {
//         List<String> lines = new ArrayList<>();
//         try (BufferedReader br = new BufferedReader(new InputStreamReader(inputStream, charset))) {
//             String line;
// 
//             afterLine += (ignoreFirstLine ? 1 : 0);
// 
//             for (int i = 0; i < afterLine; i++) {
//                 line = br.readLine();
//             }
// 
//             line = br.readLine();
//             while (!isEof(line, eofCharacter)) {
//                 if (!line.trim().isEmpty()) {
//                     lines.add(line);
//                 }
//                 line = br.readLine();
//             }
//         }
// 
//         if (ignoreLastLines > 0 && lines.size() >= ignoreLastLines) {
//             lines = lines.subList(0, lines.size() - ignoreLastLines);
//         }
// 
//         return lines;
//     }
// 
//     private static boolean isEof(String line, String eofCharacter) {
//         return line == null || (eofCharacter != null && line.contains(eofCharacter));
//     }
// 
// }


import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import org.reflections.ReflectionUtils;
import com.google.common.collect.Iterables;
import com.google.common.primitives.Ints;
import lombok.AllArgsConstructor;
import lombok.Getter;
import br.com.tecsinapse.dataio.annotation.FixedLengthColumn;
import br.com.tecsinapse.dataio.annotation.LineFixedLengthFile;
import br.com.tecsinapse.dataio.converter.Converter;
import br.com.tecsinapse.dataio.util.FixedLengthFileUtil;

        final Constructor<T> constructor = clazz.getDeclaredConstructor();
        constructor.setAccessible(true);
        for (int i = 0; i < lines.size(); i++) {
            T instance = constructor.newInstance();
            String workingLine = lines.get(i);
            boolean ignoreLine = false;
            for (AnnotationMethod annotationMethod : methodsAndAnnotations) {
                if (workingLine.length() == 0) {
                    break;
                }
                Method method = annotationMethod.getMethod();
                FixedLengthColumn flc = annotationMethod.getFlc();
                final boolean naoValidouTamanhoDaLinha = !flc.useLineLength() && workingLine.length() < flc.columnSize() && !ignoreColumnLengthError;
                if (naoValidouTamanhoDaLinha) {
                    if (ignoreLineWhenError) {
                        ignoreLine = true;
                        break;
                    } else {
                        int line = ignoreFirstLine ? i + 1 : i;
                        throw new IllegalStateException(String.format(
                                "Malformed file or wrong configuration. Line %s size doesn't match the configuration.",
                                line));
                    }
                }
                int length = flc.useLineLength() || workingLine.length() < flc.columnSize() ? workingLine.length() : flc.columnSize();
                String value = workingLine.substring(0, length).trim();
                if (removeDuplicatedSpaces) {
                    value = value.replaceAll("\\s+", " ");
                }
// Path: src/main/java/br/com/tecsinapse/dataio/converter/Converter.java
// public interface Converter<F, T> {
//     T apply(F input);
//     T apply(String input);
// }
// 
// Path: src/main/java/br/com/tecsinapse/dataio/util/FixedLengthFileUtil.java
// @UtilityClass
// public final class FixedLengthFileUtil {
// 
//     public static List<String> getLines(InputStream inputStream, boolean ignoreFirstLine, Charset charset) throws IOException {
//         return getLines(inputStream, ignoreFirstLine, 0, null, charset);
//     }
// 
//     private static List<String> getLines(InputStream inputStream, boolean ignoreFirstLine, int afterLine, String eofCharacter, Charset charset) throws IOException {
//         return getLines(inputStream, ignoreFirstLine, afterLine, 0, eofCharacter, charset);
//     }
// 
//     public static List<String> getLines(InputStream inputStream, boolean ignoreFirstLine, int afterLine, int ignoreLastLines, String eofCharacter, Charset charset) throws IOException {
//         List<String> lines = new ArrayList<>();
//         try (BufferedReader br = new BufferedReader(new InputStreamReader(inputStream, charset))) {
//             String line;
// 
//             afterLine += (ignoreFirstLine ? 1 : 0);
// 
//             for (int i = 0; i < afterLine; i++) {
//                 line = br.readLine();
//             }
// 
//             line = br.readLine();
//             while (!isEof(line, eofCharacter)) {
//                 if (!line.trim().isEmpty()) {
//                     lines.add(line);
//                 }
//                 line = br.readLine();
//             }
//         }
// 
//         if (ignoreLastLines > 0 && lines.size() >= ignoreLastLines) {
//             lines = lines.subList(0, lines.size() - ignoreLastLines);
//         }
// 
//         return lines;
//     }
// 
//     private static boolean isEof(String line, String eofCharacter) {
//         return line == null || (eofCharacter != null && line.contains(eofCharacter));
//     }
// 
// }


// Path: src/main/java/br/com/tecsinapse/dataio/importer/parser/FixedLengthFileParser.java
import java.io.File;
import java.io.FileInputStream;
import java.io.IOException;
import java.io.InputStream;
import java.lang.reflect.Constructor;
import java.lang.reflect.Method;
import java.nio.charset.Charset;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import org.reflections.ReflectionUtils;
import com.google.common.collect.Iterables;
import com.google.common.primitives.Ints;
import lombok.AllArgsConstructor;
import lombok.Getter;
import br.com.tecsinapse.dataio.annotation.FixedLengthColumn;
import br.com.tecsinapse.dataio.annotation.LineFixedLengthFile;
import br.com.tecsinapse.dataio.converter.Converter;
import br.com.tecsinapse.dataio.util.FixedLengthFileUtil;


        final Constructor<T> constructor = clazz.getDeclaredConstructor();
        constructor.setAccessible(true);
        for (int i = 0; i < lines.size(); i++) {
            T instance = constructor.newInstance();
            String workingLine = lines.get(i);
            boolean ignoreLine = false;
            for (AnnotationMethod annotationMethod : methodsAndAnnotations) {
                if (workingLine.length() == 0) {
                    break;
                }
                Method method = annotationMethod.getMethod();
                FixedLengthColumn flc = annotationMethod.getFlc();
                final boolean naoValidouTamanhoDaLinha = !flc.useLineLength() && workingLine.length() < flc.columnSize() && !ignoreColumnLengthError;
                if (naoValidouTamanhoDaLinha) {
                    if (ignoreLineWhenError) {
                        ignoreLine = true;
                        break;
                    } else {
                        int line = ignoreFirstLine ? i + 1 : i;
                        throw new IllegalStateException(String.format(
                                "Malformed file or wrong configuration. Line %s size doesn't match the configuration.",
                                line));
                    }
                }
                int length = flc.useLineLength() || workingLine.length() < flc.columnSize() ? workingLine.length() : flc.columnSize();
                String value = workingLine.substring(0, length).trim();
                if (removeDuplicatedSpaces) {
                    value = value.replaceAll("\\s+", " ");
                }
                Converter<?, ?> converter = flc.converter().newInstance();