⥠A high-performance, zero-allocation byte processing library for Java, engineered for direct manipulation of primitive byte arrays without the devastating overhead of String instantiation or UTF-16 transcoding.
FastASCII is the foundational byte-level standard library for the FastJava ecosystem.
To achieve a completely responsive, zero-latency parsing and rendering experience, FastASCII is the invisible backbone designed to power the rest of the FastJava ecosystem:
- ⥠FastANSI â Relies on FastASCII for byte-native escape sequence scanning.
- đ FastTerminal â Uses FastASCII to compose ANSI streams directly to memory for 60+ FPS rendering.
- đ±ïž FastMouse â Depends on FastASCII for ultra-fast integer tracking directly from standard input.
// Quick Start â Example
import fastascii.FastASCIIWriter;
import fastascii.FastASCIIReader;
public class Demo {
public static void main(String[] args) {
byte[] buffer = new byte[1024];
// Write integers directly to bytes (Zero Allocation!)
int bytesWritten = FastASCIIWriter.writeInt(buffer, 0, 404);
// Write UTF-8 codepoints natively
bytesWritten += FastASCIIWriter.writeUtf8(buffer, bytesWritten, 0x1F680); // đ
// Parse unsigned integers blazingly fast
int parsed = FastASCIIReader.parseUInt(buffer, 0, 3);
System.out.println("Parsed: " + parsed);
}
}The mission is to build the fastest, most robust byte manipulation kernel on the JVM. Java's standard library forces expensive String allocations and UTF-8 to UTF-16 conversions that destroy performance in hot loops. FastASCII operates exclusively on primitives, empowering developers to create parsers and renderers that redefine Java performance by pushing the absolute limits of the HotSpot JIT compiler.
- đ« Zero Allocations â Bypasses all
String,StringBuilder, andMatcherinstantiations. - ⥠JIT-Optimized Java â The core layer is pure Java, written specifically to trigger aggressive HotSpot compiler inlining for small buffers (like ANSI codes).
- đ Native UTF-8 Encoding â Validates, encodes, and decodes UTF-8 codepoints natively at blazing speeds.
- đŻ Universal Parsers â Built-in highly-optimized scalar search functions for
indexOf, whitespace skipping, and integer parsing.
| Method | Description | Component |
|---|---|---|
writeInt(buffer, offset, value) |
Writes an integer directly into a byte buffer. | FastASCIIWriter |
writeUtf8(buffer, offset, cp) |
Encodes a codepoint directly to UTF-8 bytes. | FastASCIIWriter |
parseUInt(buffer, start, end) |
Blazing fast unsigned integer parsing from bytes. | FastASCIIReader |
find(haystack, offset, len, needle) |
Zero-allocation indexOf replacement. |
FastASCIIScanner |
decodeCodePoint(buf, off, len, out) |
High-throughput UTF-8 to UTF-32 decoding. | FastUTF8 |
Add the JitPack repository and the dependencies to your pom.xml:
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
<dependencies>
<!-- FastASCII Library -->
<dependency>
<groupId>com.github.andrestubbe</groupId>
<artifactId>fastascii</artifactId>
<version>0.1.0</version>
</dependency>
</dependencies>repositories {
maven { url 'https://jitpack.io' }
}
dependencies {
implementation 'com.github.andrestubbe:fastascii:0.1.0'
}Download the latest JARs directly to add them to your classpath:
- đŠ fastascii-0.1.0.jar (The Core Library)
MIT License â See LICENSE file for details.
Part of the FastJava Ecosystem â Making the JVM faster. Small package. Maximum speed. Zero bloat. đđ
