Konloch Software

DiskLib

Published 02/14/2023 Updated 02/27/2023

DiskLib is an easy-to-use zero dependency Disk Writer & Disk Reader with built-in GZIP support for Java.

What Does It Do?

  • Small, easy to use Java Library that provides an API for reading and writing files.

Links

Requirements

  • Java 8 or greater

How To Integrate as a Dependency

Add the following to your pom.xml as a maven dependency, or just download the latest release and import it with your IDE.

<dependency>
  <groupId>com.konloch</groupId>
  <artifactId>DiskLib</artifactId>
  <version>2.2.0</version>
</dependency>

How To Use (Reading)

Reading Strings from disk

ArrayList<String> lines = DiskReader.read("hello.txt");

Reading String Arrays from disk

String[] lines = DiskReader.readLines("hello.txt");

Reading Bytes from disk

byte[] bytes = DiskReader.readBytes("hello.txt");

How To Use (Writing)

  • You can write / append Lists, or Sets, just pass where the string parameter goes for the content line.

Write new file to disk / overwrite existing file

DiskReader.write("hello.txt", "Hello ");

Append to existing file

DiskReader.append("hello.txt", "World");

Latest Updates

DiskLib v1.2.0

This has been heavily tested but please feel free to report any issues found.

To add it as a maven dependency:

<dependency> 
 <groupId>com.konloch</groupId> 
 <artifactId>DiskLib</artifactId>.
Read More

DiskLib v1.1.0

This has been heavily tested but please feel free to report any issues found.

To add it as a maven dependency:

<dependency> 
 <groupId>com.konloch</groupId> 
 <artifactId>DiskLib</artifactId>.
Read More

DiskLib v1.0.1

This has been heavily tested but please feel free to report any issues found.

To add it as a maven dependency:

<dependency> 
 <groupId>com.konloch</groupId> 
 <artifactId>DiskLib</artifactId>.
Read More

DiskLib v1.0.0

This is the first public release of the library, it has been heavily tested but please feel free to report any issues found.

Links

Read More