The intelligent file reader for Java β blazing fast, zero config, and async-ready.
π Read any file. π§ Choose the best method. π Perform like a pro.
β
Zero Config β Just drop in and start reading files.
β
Adaptive Engine β Chooses the best reading method based on file size.
β
Built-in Async β Boost performance with CompletableFuture
.
β
Stream-Friendly β Sync & async line streaming.
β
Charset Control β Easily switch encodings.
β
Lightweight β Minimal dependencies, fast and focused.
- π Read text files into memory (
StringBuilder
) - π€ Automatically chooses efficient read strategy (Buffered, NIO, Mapped)
- β±οΈ Read files asynchronously
- π₯ Line-by-line streaming (sync & async)
- π Support for multiple charsets (UTF-8, ISO-8859-1, UTF-16 etc.)
- π§ͺ Simple API ideal for logging, parsing, and file analysis
<dependency>
<groupId>io.github.raghul-tech</groupId>
<artifactId>openloom</artifactId>
<version>0.0.2</version>
</dependency>
implementation 'io.github.raghul-tech:openloom:0.0.2'
OpenLoom reader = new OpenLoom();
StringBuilder content = reader.read(new File("example.txt"));
System.out.println(content);
StringBuilder content = reader.read(Paths.get("data/example.txt"));
reader.readAsync(new File("large.txt")).thenAccept(content -> {
System.out.println("First 100 chars: " + content.substring(0, 100));
});
reader.streamLines(new File("log.txt"), System.out::println);
reader.streamLinesAsync(Paths.get("errors.log"), line -> {
if (line.contains("ERROR")) System.err.println("Error line: " + line);
});
OpenLoom reader = new OpenLoom(StandardCharsets.ISO_8859_1);
StringBuilder content = reader.read(Paths.get("legacy.txt"));
reader.setCharset(StandardCharsets.UTF_16);
javac -cp openloom-0.0.2.jar ReadExampleWithFile.java
Windows:
java -cp .;openloom-0.0.2.jar ReadExampleWithFile
Linux/macOS:
java -cp .:openloom-0.0.2.jar ReadExampleWithFile
- Java 8 or above (JDK 17+ recommended)
β Ready-to-run examples in the examples/ folder:
-
View all releases on the Releases Page.
-
For a detailed log of all changes, refer to the CHANGELOG.md file.
-
We welcome PRs for:
-
π Bug fixes
-
π New features
-
π§ͺ More examples
-
π Documentation
-
Read the Contributing Guide before starting..
- If you've encountered a bug, please report it by clicking the link below. This will guide you through the bug-reporting process: β‘οΈ Click here to report a bug
- This project is licensed under the Apache License 2.0.
Email: raghultech.app@gmail.com
If OpenLoom helped you, you can support it here β€οΈ