What is FastProto?

Build codecov Codacy JetBrains License

FastProto is a lightweight Java library that makes binary protocols effortless. Simply annotate your data structure and let FastProto deal with the byte‑level work.

Key Features

Annotation‑Driven
Quickly map binary data to Java fields.
Broad Type Support
Primitives, unsigned numbers, strings, time types, arrays and collections.
Flexible Addressing
Reverse addressing for variable‑length packets.
Configurable Byte & Bit Order
Big‑endian or little‑endian; MSB/LSB bit ordering.
Custom Formulas
Use lambdas or classes to transform values during encode/decode.
Checksum/CRC
Single‑annotation @Checksum with CRC8/16/32/64, LRC, XOR.
Easy APIs
Multiple APIs tuned for efficiency and reliability.

Basic Usage

import org.indunet.fastproto.FastProto;
import org.indunet.fastproto.annotation.UInt8Type;

public class Packet {
  @UInt8Type(offset = 0) int id;
}

byte[] bytes = new byte[]{1};
Packet p = FastProto.decode(bytes, Packet.class);
byte[] out = FastProto.encode(p, 1);

Install

Maven

<dependency>
  <groupId>org.indunet</groupId>
  <artifactId>fastproto</artifactId>
  <version>3.12.1</version>
</dependency>

Gradle

implementation "org.indunet:fastproto:3.12.1"

License

FastProto is released under the Apache License 2.0. Commercial‑friendly and widely adopted.

Source code on GitHub. Artifacts on Maven Central.