import java.io.IOException;
import java.nio.ByteBuffer;
import java.nio.ByteOrder;
import java.nio.channels.FileChannel;
import java.nio.file.Files;
import java.nio.file.Path;
import java.nio.file.StandardOpenOption;
import java.util.ArrayList;
import java.util.List;
import java.util.stream.Collectors;

public class ConfigReader {

    public static void main(String[] args) {
        String configFolderPath = "/storage/emulated/0/Android/data/com.tencent.tmgp.pubgmhd/files/UE4Game/ShadowTrackerExtra/ShadowTrackerExtra/Saved/Config/Android";
        
        try {
            Path configPath = Path.of(configFolderPath);
            
            if (!Files.exists(configPath)) {
                System.out.println("Config folder not exist: " + configFolderPath);
                return;
            }
            
            if (Files.isDirectory(configPath)) {
                List<Path> configFiles = readConfigFiles(configPath);
                System.out.println("Found " + configFiles.size() + " config files:");
                
                for (Path file : configFiles) {
                    System.out.println("Reading file: " + file.getFileName());
                    readConfigFile(file);
                    System.out.println("----------------------------");
                }
            } else {
                readConfigFile(configPath);
            }
            
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    
    private static List<Path> readConfigFiles(Path folderPath) throws IOException {
        List<Path> configFiles = new ArrayList<>();
        
        Files.walk(folderPath, 1)
            .filter(Files::isRegularFile)
            .forEach(configFiles::add);
            
        return configFiles;
    }
    
    private static void readConfigFile(Path filePath) {
        try (FileChannel fileChannel = (FileChannel) Files.newByteChannel(filePath, StandardOpenOption.READ)) {
            
            long fileSize = fileChannel.size();
            int bufferSize = (int) Math.min(fileSize, 8192);
            
            ByteBuffer buffer = ByteBuffer.allocate(bufferSize);
            fileChannel.read(buffer);
            buffer.flip();
            
            String content = new String(buffer.array(), 0, buffer.remaining(), "UTF-8");
            System.out.println("File size: " + fileSize + " bytes");
            System.out.println("File content:");
            System.out.println(content);
            
        } catch (IOException e) {
            System.err.println("Read file failed: " + filePath.getFileName());
            e.printStackTrace();
        }
    }
    
    private static void readEntireConfigFile(Path filePath) {
        try {
            byte[] fileContent = Files.readAllBytes(filePath);
            String content = new String(fileContent, "UTF-8");
            
            System.out.println("File: " + filePath.getFileName());
            System.out.println("Size: " + fileContent.length + " bytes");
            System.out.println("Content:");
            System.out.println(content);
            
        } catch (IOException e) {
            System.err.println("Read file failed: " + filePath.getFileName());
            e.printStackTrace();
        }
    }
}

class ConfigReaderWithFilter {

    public static void main(String[] args) {
        String configFolderPath = "/storage/emulated/0/Android/data/com.tencent.tmgp.pubgmhd/files/UE4Game/ShadowTrackerExtra/ShadowTrackerExtra/Saved/Config/Android";
        
        try {
            Path configPath = Path.of(configFolderPath);
            
            if (!Files.exists(configPath)) {
                System.out.println("Config folder not exist: " + configFolderPath);
                return;
            }
            
            List<Path> iniFiles = getIniConfigFiles(configPath);
            System.out.println("Found " + iniFiles.size() + " INI config files:");
            
            for (Path file : iniFiles) {
                System.out.println("\n=== Reading file: " + file.getFileName() + " ===");
                readEntireConfigFile(file);
            }
            
        } catch (IOException e) {
            e.printStackTrace();
        }
    }
    
    private static List<Path> getIniConfigFiles(Path folderPath) throws IOException {
        return Files.walk(folderPath, 1)
            .filter(Files::isRegularFile)
            .filter(path -> path.toString().toLowerCase().endsWith(".ini"))
            .collect(Collectors.toList());
    }
    
    private static void readEntireConfigFile(Path filePath) {
        try {
            List<String> lines = Files.readAllLines(filePath);
            
            System.out.println("File size: " + Files.size(filePath) + " bytes");
            System.out.println("Line count: " + lines.size());
            System.out.println("Content:");
            
            int maxLinesToShow = Math.min(lines.size(), 50);
            for (int i = 0; i < maxLinesToShow; i++) {
                System.out.println(lines.get(i));
            }
            
            if (lines.size() > 50) {
                System.out.println("... (showing first 50 lines only)");
            }
            
        } catch (IOException e) {
            System.err.println("Read file failed: " + filePath.getFileName());
            e.printStackTrace();
        }
    }
}
```