https://github.com/bethibande/serialization
Low-latency Java serialization
https://github.com/bethibande/serialization
java serialization
Last synced: 2 months ago
JSON representation
Low-latency Java serialization
- Host: GitHub
- URL: https://github.com/bethibande/serialization
- Owner: Bethibande
- License: mit
- Created: 2025-05-01T08:09:27.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-07-04T13:32:37.000Z (12 months ago)
- Last Synced: 2025-07-04T15:10:44.872Z (12 months ago)
- Topics: java, serialization
- Language: Java
- Homepage:
- Size: 161 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Java Serialization
This project aims to create a low-latency serialization framework for Java.
> [!CAUTION]
> This framework is still very much work-in-progress. Non-experimental usage is not yet recommended.
### Example
```java
import java.nio.ByteBuffer;
@Getter
@Setter
@SerializableType
public class MyClass {
private int someInteger;
private boolean someBoolean;
private String someString;
}
public static void main(String[] args) {
final ByteBuffer buffer = ByteBuffer.allocateDirect(64);
final Writer writer = new ByteBufferWriter(buffer);
final Reader reader = new ByteBufferReader(buffer);
final MyClass myObject = new MyClass();
myObject.setSomeInteger(123);
myObject.setSomeBoolean(true);
myObject.setSomestring("abc");
final MyClassSerializer serializer = new MyClassSerializer();
serializer.bind(writer).write(myObject);
buffer.flip();
final MyClassDeserializer deserializer = new MyClassDeserializer();
final MyClass output = deserializer.bind(reader).read(new MyClass());
}
```
For more examples see [here](/example/src/main/java/de/bethibande/serial/example/Main.java)
### Type support
- ✅ Fully supported
- ❌ Not yet supported
| Type | Support |
|--------------------------|---------|
| Any primitive type | ✅ |
| Any boxed primitive type | ✅ |
| String / CharSequence | ✅ |
| Any enum type | ✅ |
| Arrays | ✅ |
| Collections | ✅ |
| Other serializable types | ✅ |
| Maps | ❌ |
| Java time types | ❌ |
Please note that not null annotations are supported. Marking nullable fields as not nullable will omit null-checks,
doing so can cause null pointer exceptions at runtime in the event that such a field does contain a null value.
However, serializing/deserializing not nullable fields is faster.