{"id":35782721,"url":"https://github.com/oak/sbs4j","last_synced_at":"2026-01-07T06:05:32.723Z","repository":{"id":43337035,"uuid":"466217392","full_name":"oak/sbs4j","owner":"oak","description":"Simple binary serialization library for Java.","archived":false,"fork":false,"pushed_at":"2023-05-04T09:50:38.000Z","size":1930,"stargazers_count":1,"open_issues_count":3,"forks_count":1,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-27T06:31:54.197Z","etag":null,"topics":["java","serialization"],"latest_commit_sha":null,"homepage":"https://oak.github.io/sbs4j/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/oak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":"SECURITY.md","support":null}},"created_at":"2022-03-04T17:43:13.000Z","updated_at":"2022-09-22T11:18:30.000Z","dependencies_parsed_at":"2023-01-18T00:45:44.961Z","dependency_job_id":null,"html_url":"https://github.com/oak/sbs4j","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/oak/sbs4j","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oak%2Fsbs4j","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oak%2Fsbs4j/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oak%2Fsbs4j/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oak%2Fsbs4j/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/oak","download_url":"https://codeload.github.com/oak/sbs4j/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/oak%2Fsbs4j/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28233243,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2026-01-07T02:00:05.975Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["java","serialization"],"created_at":"2026-01-07T06:04:21.764Z","updated_at":"2026-01-07T06:05:32.675Z","avatar_url":"https://github.com/oak.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sbs4j (Simple Byte Serializer for Java)\n\n[![Java CI](https://github.com/oak/sbs4j/actions/workflows/build.yml/badge.svg)](https://github.com/oak/sbs4j/actions/workflows/build.yml)\n![GitHub tag (latest SemVer)](https://img.shields.io/github/v/tag/oak/sbs4j?sort=semver)\n[![Project license](https://img.shields.io/badge/license-Apache%202-blue)](https://www.apache.org/licenses/LICENSE-2.0.txt)\n\nThis project aims to be a simple but effective java primitives and object byte array serializer/deserializer.\n\n## Dependencies\n\n- Java 8+\n- Maven (via wrapper)\n\n## Build instructions\n\n```\n./mvnw package\n```\n\n## How to\n\nThe library provides two interfaces: [`SerializableObject`] and [`DeserializableObject`]. One for implementing object\nserialization and other for object deserialization.\n\nAlso, it includes two classes: [`SerializerBuffer`] and [`DeserializerBuffer`] which are instantiated and passed through\nthe object hierarchy either serializing or deserializing its values.\n\n### Including the library dependency\n\n#### Using Maven\n\n``` xml\n\u003cdependency\u003e\n    \u003cgroupId\u003edev.oak3\u003c/groupId\u003e\n    \u003cartifactId\u003esbs4j\u003c/artifactId\u003e\n    \u003cversion\u003eVERSION\u003c/version\u003e\n\u003c/dependency\u003e\n```\n\n#### Using gradle\n\n``` groovy\nimplementation 'dev.oak3:sbs4j:VERSION'\n```\n\n### Usage\n\nYou can find more examples on the [`tests`] folder\n\n``` java\npublic final class Example {\n  public static byte[] serializePoint() {\n      SerializerBuffer serializerBuffer = new SerializerBuffer();\n      \n      Point point = new Point(4, 2, 9);\n      point.serialize(serializerBuffer);\n      \n      byte[] serializedBytes = serializerBuffer.toByteArray();\n      \n      return serializedBytes;\n  }\n  \n  public static Point deserializePoint() {\n      ObjectDeserializer deserializerBuffer = new ObjectDeserializer();\n      \n      byte[] serializedBytes = new byte[]{4, 0, 0, 0, 2, 0, 0, 0, 9, 0, 0, 0};\n      \n      deserializerBuffer.deserialize(serializedBytes);    \n  \n      Point point = new Point();\n      point.deserialize(deserializerBuffer);\n      \n      return point;\n  }\n}\n\npublic class Point implements SerializableObject, DeserializableObject {\n    private int x;\n    private int y;\n    private int z;\n\n    // ... getters, setters, constructors...\n\n    @Override\n    public void serialize(ObjectSerializer serializer) {\n        // The written order...\n        serializer.writeI32(x);\n        serializer.writeI32(y);\n        serializer.writeI32(z);\n    }\n\n    @Override\n    public void deserialize(ObjectDeserializer deserializer) throws ValueDeserializationException {\n        // ...defines the read order\n        this.x = deserializer.readI32();\n        this.y = deserializer.readI32();\n        this.z = deserializer.readI32();\n    }\n}\n```\n\n## Primitive Type Mappings\n\n| sbs4j          | Java         | Status      |\n|----------------|--------------|-------------|\n| `boolean` byte | `boolean`    | implemented |\n| `u8` integer   | `byte`       | implemented |\n| `u16` integer  | `short`      | implemented |\n| `i32` integer  | `int`        | implemented |\n| `u32` integer  | `long`       | implemented |\n| `i64` integer  | `long`       | implemented |\n| `u64` integer  | `BigInteger` | implemented |\n| `u128` integer | `BigInteger` | implemented |\n| `u256` integer | `BigInteger` | implemented |\n| `u512` integer | `BigInteger` | implemented |\n| `u128` integer | `BigInteger` | implemented |\n| `f32` float    | `float`      | implemented |\n| `f64` float    | `double`     | implemented |\n\n## Roadmap\n\nThe following features are planned to be supported:\n\n- Ensure Android support\n- Improve support for customization\n- Helper methods for serializing/deserializing more complex objects easier and with less code (e.g., List, Map,\n  Optional, etc.).\n- Alternative reflection-based serialization and deserialization (i.e., process an object and its fields without writing any custom\n  code).\n\n[`SerializerBuffer`]: https://github.com/oak/sbs4j/blob/main/src/main/java/dev/oak3/sbs4j/SerializerBuffer.java\n\n[`DeserializerBuffer`]: https://github.com/oak/sbs4j/blob/main/src/main/java/dev/oak3/sbs4j/DeserializerBuffer.java\n\n[`SerializableObject`]: https://github.com/oak/sbs4j/blob/main/src/main/java/dev/oak3/sbs4j/interfaces/SerializableObject.java\n\n[`DeserializableObject`]: https://github.com/oak/sbs4j/blob/main/src/main/java/dev/oak3/sbs4j/interfaces/DeserializableObject.java\n\n[`tests`]: https://github.com/oak/sbs4j/blob/main/src/test/java/dev/oak3/sbs4j/","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foak%2Fsbs4j","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Foak%2Fsbs4j","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Foak%2Fsbs4j/lists"}