Skip to content

smallrye/smallrye-serial

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

SmallRye Build Maven Central License

SmallRye Serial

A safe and efficient Java serialization library that captures serialized object graphs into a structured, inspectable intermediate representation rather than an opaque byte stream.

Overview

SmallRye Serial serializes Java objects into a tree of Serialized nodes that can be examined, transformed, or stored before being deserialized back into live objects. It supports the full range of Java serialization mechanisms:

  • Serializable classes (including custom writeObject/readObject)
  • Externalizable classes
  • Records
  • Enums
  • Proxies
  • writeReplace/readResolve
  • Circular and self-referencing object graphs

Usage

Maven dependency

Add the following to the dependencies section of your pom.xml:

<dependency>
    <groupId>io.smallrye.serial</groupId>
    <artifactId>smallrye-serial</artifactId>
    <version>VERSION</version>
</dependency>

Replace VERSION with the latest release version.

Getting started

Create a SerialContext, then use it to serialize and deserialize objects:

// Build a context with the default serialization providers
SerialContext ctx = SerialContext.builder()
    .addDefaultProviders()
    .build();

// Serialize an object into its intermediate representation
Serialized serialized = ctx.serialize(myObject);

// Deserialize back into a live object
Object restored = ctx.deserialize(serialized);

JPMS module

The module name is io.smallrye.serial.

module my.module {
    requires io.smallrye.serial;
}

Build

mvn verify

Contributing

Please refer to the SmallRye Wiki for the Contribution Guidelines.

License

This project is licensed under the Apache License 2.0.

About

A safe and efficient Java serialization library

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages