Nippyfile J -

Add the dependency to your build system.

| Method | Return | Description | |--------|--------|-------------| | static NippyFile of(Path p) | NippyFile | Factory – validates non‑null and normalises the path. | | byte[] readAllBytes() | byte[] | Reads entire file into a byte array (uses FileChannel + ByteBuffer ). | | String readAllText() | String | Reads whole file as UTF‑8 string (or readAllText(Charset) ). | | List<String> readLines() | List<String> | Reads all lines, trimming line‑terminators. | | NippyFile writeAllBytes(byte[] data) | NippyFile | Overwrites file with the supplied bytes (creates parent dirs). | | NippyFile writeAllText(String text) | NippyFile | Writes UTF‑8 text (or custom charset). | | NippyFile writeLines(Collection<String> lines) | NippyFile | Writes each element as a separate line ( \n ). | | NippyFile copyTo(Path target, boolean overwrite) | NippyFile | Zero‑copy copy using FileChannel.transferTo . | | NippyFile moveTo(Path target, boolean overwrite) | NippyFile | Atomic move (fallback to copy+delete). | | InputStream asInputStream() | InputStream | Buffered stream; closes on close() . | | OutputStream asOutputStream() | OutputStream | Buffered stream; closes on close() . | | NippyFile zipTo(Path zipFile) | NippyFile | Packs the file into a ZIP (single‑entry). | | NippyFile unzipTo(Path dir) | NippyFile | Extracts a ZIP (must be a ZIP file). | | Path tempFile(String prefix, String suffix) | Path | Creates a temporary file that auto‑deletes on JVM exit. | | long size() | long | File size in bytes (throws if not existent). | | boolean exists() | boolean | Shortcut for Files.exists . | | NippyFile ensureParentExists() | NippyFile | Creates missing parent directories (no‑op if already present). | | CompletableFuture<byte[]> readAllBytesAsync() | CompletableFuture<byte[]> | Non‑blocking read using java.nio.file.AsynchronousFileChannel . | | CompletableFuture<NippyFile> writeAllBytesAsync(byte[] data) | CompletableFuture<NippyFile> | Non‑blocking write. | | NippyFile readOnly() / writeOnly() | NippyFile | Locks the wrapper to a specific mode (throws on illegal ops). | nippyfile j

Write, read, copy, zip, and stream files with a clean, fluent API that works on any JVM (including Android). Add the dependency to your build system

| Category | Feature | Short Description | |----------|---------|-------------------| | | readAllBytes() , writeAllBytes() | One‑liner read/write of whole files. | | | readLines() , writeLines() | Stream‑friendly line handling (UTF‑8, custom charset). | | | copyTo(Path target) , moveTo(Path target) | Atomic copy/move with optional overwrite modes. | | | transferTo(OutputStream) | Zero‑copy transfer for large binary blobs. | | Streaming | asInputStream() , asOutputStream() | Lazy, buffered streams that auto‑close. | | | asReader(Charset) , asWriter(Charset) | Character‑stream support. | | Compression | zipTo(Path zipFile) , unzipTo(Path dir) | One‑line ZIP creation/extraction (supports password‑less ZIP only). | | Temp Files | asTempFile(prefix, suffix) | Auto‑deleted temporary file with try‑with‑resources. | | Safety | readOnly() , writeOnly() | Explicitly restrict access mode. | | Async | readAllBytesAsync() , writeAllBytesAsync() | CompletableFuture‑based non‑blocking IO (Java 8+). | | Metrics | size() , lastModified() , isHidden() | Quick meta‑data access. | | Validation | exists() , ensureParentExists() | Guard clauses that throw NippyFileException . | | Extensibility | registerCustomCodec(Codec) | Plug in your own compression or serialization format. | | | String readAllText() | String | Reads

All data is encrypted at rest (AES‑256) and in transit (TLS 1.3), with optional client‑side encryption keys for zero‑knowledge security.