{"id":24321116,"url":"https://github.com/simonit/gdx-cbor","last_synced_at":"2026-01-06T17:22:58.211Z","repository":{"id":272917723,"uuid":"915816613","full_name":"SimonIT/gdx-cbor","owner":"SimonIT","description":"CBOR adapters to use with libGDX","archived":false,"fork":false,"pushed_at":"2025-05-13T10:03:41.000Z","size":126,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-20T01:05:05.000Z","etag":null,"topics":["cbor","libgdx","serialization"],"latest_commit_sha":null,"homepage":"","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/SimonIT.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2025-01-12T21:48:33.000Z","updated_at":"2025-05-13T10:03:44.000Z","dependencies_parsed_at":"2025-01-17T12:56:29.708Z","dependency_job_id":"0af1a630-3b41-47ae-858a-239647df1a52","html_url":"https://github.com/SimonIT/gdx-cbor","commit_stats":null,"previous_names":["simonit/gdx-cbor"],"tags_count":2,"template":false,"template_full_name":"tommyettinger/libgdx-library-template","purl":"pkg:github/SimonIT/gdx-cbor","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonIT%2Fgdx-cbor","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonIT%2Fgdx-cbor/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonIT%2Fgdx-cbor/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonIT%2Fgdx-cbor/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SimonIT","download_url":"https://codeload.github.com/SimonIT/gdx-cbor/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SimonIT%2Fgdx-cbor/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264390709,"owners_count":23600561,"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","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":["cbor","libgdx","serialization"],"created_at":"2025-01-17T16:31:30.887Z","updated_at":"2026-01-06T17:22:58.169Z","avatar_url":"https://github.com/SimonIT.png","language":"Java","funding_links":[],"categories":[],"sub_categories":[],"readme":"# gdx-cbor\n\n![Maven Central Version](https://img.shields.io/maven-central/v/dev.simonit/gdx-cbor)\n[![Build and publish](https://github.com/SimonIT/gdx-cbor/actions/workflows/build-and-publish.yml/badge.svg)](https://github.com/SimonIT/gdx-cbor/actions/workflows/build-and-publish.yml)\n[![javadoc](https://javadoc.io/badge2/dev.simonit/gdx-cbor/javadoc.svg)](https://javadoc.io/doc/dev.simonit/gdx-cbor)\n\n`gdx-cbor` is a Java library for encoding and decoding [CBOR (Concise Binary Object Representation)](https://cbor.io) data, specifically designed to work with [libGDX](https://libgdx.com/).\nIt uses the [cbor-java](https://github.com/cbor-java/cbor-java) library under the hood to encode and decode CBOR data.\n\n\u003e “The Concise Binary Object Representation (CBOR) is a data format whose design goals include the possibility of extremely small code size, fairly small message size, and extensibility without the need for version negotiation.”\n\n## Features\n\n- Encode and decode CBOR data\n- Seamless integration with libGDX\n- Supports various data types including strings, numbers, arrays, and maps\n- Easy integration with [gdx-websockets](https://github.com/MrStahlfelge/gdx-websockets) using [gdx-websocket-cbor](https://github.com/SimonIT/gdx-cbor/tree/main/gdx-websocket-cbor)\n\n## Installation\n\nAdd the dependency to your core project:\n\n```groovy\ndependencies {\n    implementation \"dev.simonit:gdx-cbor:0.0.2\"\n}\n```\n\n### GWT\n\nTo use `gdx-cbor` with GWT, you need to include the sources in your gwt project:\n\n```groovy\ndependencies {\n    implementation \"dev.simonit:gdx-cbor:0.0.2:sources\"\n}\n```\n\nThen, add the following line to your GWT module (.gwt.xml) file:\n\n```xml\n\u003cinherits name=\"dev.simonit.gdx-cbor\"/\u003e\n```\n\n## Usage\n\nBecause `gdx-cbor` is designed to work with libGDX, you can use the `Json` class to encode and decode CBOR data. The `CborReader` and `CborWriter` classes are used to read and write CBOR data, respectively. [More about libGDX Serializing and Deserializing](https://libgdx.com/wiki/utils/reading-and-writing-json)\n\n### Encoding Data\n\n```java\nimport dev.simonit.gdx.cbor.Cbor;\n\npublic void encodeData(Object data) {\n\tCbor cbor = new Cbor();\n\tbyte[] encodedData = cbor.toCbor(data);\n}\n```\n\n(all other `cbor.toJson()` methods also produce CBOR data!)\n\n### Decoding Data\n\n```java\nimport dev.simonit.gdx.cbor.Cbor;\n\npublic void decodeData(byte[] data) {\n\tCbor cbor = new Cbor();\n\tObject obj = cbor.fromCbor(Object.class, data);\n}\n```\n\n(all other `cbor.fromJson()` methods also read CBOR data!)\n\n#### Reading to DOM\n\n```java\nimport dev.simonit.gdx.cbor.CborReader;\nimport dev.simonit.gdx.cbor.CborValue;\n\npublic void readCborData(byte[] data) {\n\tCborValue root = new CborReader().parse(data);\n}\n```\n\n## Contributing\n\nContributions are welcome! Please open an issue or submit a pull request on GitHub.\n\n## License\n\nThis project is licensed under the Apache License 2.0. See the [LICENSE](LICENSE) file for more information.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonit%2Fgdx-cbor","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsimonit%2Fgdx-cbor","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsimonit%2Fgdx-cbor/lists"}