Skip to content

A Java implementation of the IPLD cbor format

License

Notifications You must be signed in to change notification settings

chaingrok/java-ipld-cbor

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 

Repository files navigation

java-ipld-cbor

A Java implementation of the IPLD cbor format

This is the ipld serialization implementation in Java.

Table of Contents

Install

Simply clone this repo.

Usage

// Serialization
List<CborObject> list = new ArrayList<>();
list.add(new CborObject.CborString("A value"));
list.add(new CborObject.CborByteArray("A value".getBytes()));
list.add(new CborObject.CborNull());
list.add(new CborObject.CborBoolean(true));
CborObject.CborList cborList = new CborObject.CborList(list);
byte[] raw = cborList.toByteArray();

// Deserialization
CborObject deserialized = CborObject.fromByteArray(raw);

// Custom classes can implement Cborable to implement their own cbor format (with a corresponding static fromCbor method)

Dependency

You can use this project by building the JAR file as specified below, or by using JitPack (also supporting Gradle, SBT, etc).

for Maven, you can add the follwing sections to your POM.XML:

  <repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
  </repositories>

  <dependencies>
    <dependency>
      <groupId>com.github.ipld</groupId>
      <artifactId>java-ipld-cbor</artifactId>
      <version>v1.0.0</version>
    </dependency>
  </dependencies>

Testing

Ant

ant test

Maven

mvn test

Building

Ant

ant dist will build a JAR file in the ./dist suitable for manual inclusion in a project. Dependent libraries are included in ./dist/lib.

Maven

mvn package will build a JAR file with Maven dependency information.

Releasing

The version number is specified in build.xml and pom.xml and must be changed in both places in order to be accurately reflected in the JAR file manifest. A git tag must be added in the format "vx.x.x" for JitPack to work.

Maintainers

Captain: @ianopolous.

Contribute

Contributions welcome. Please check out the issues.

Check out our contributing document for more information on how we work, and about contributing in general. Please be aware that all interactions related to IPLD are subject to the IPFS Code of Conduct.

Small note: If editing the Readme, please conform to the standard-readme specification.

License

MIT © 2016 Ian Preston, Christopher Boddy

[Apache v2] © 2013 J.W. Janssen

About

A Java implementation of the IPLD cbor format

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Java 100.0%