SkillAgentSearch skills...

DiskLib

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

Install / Use

/learn @Konloch/DiskLib
About this skill

Quality Score

0/100

Supported Platforms

Universal

README

DiskLib

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

💡 Requirements

  • Java Runtime 1.8 or higher

⚙️ How To Add As Library

Add it as a maven dependency or just download the latest release.

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

📚 Links

💻 How To Use

You can pass either a String path or a File object for the first parameter. To use the GZIP functionality, use GZIPDiskReader or GZIPDiskWriter

For more examples

View the test file here, it has examples of each function being used.

⬆️ 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");

⬇️ 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");

Related Skills

View on GitHub
GitHub Stars9
CategoryCustomer
Updated2y ago
Forks0

Languages

Java

Security Score

75/100

Audited on Aug 11, 2023

No findings