DataUrl

A library to create and parse RFC 2397 data urls.

License

License

Categories

Categories

Data
GroupId

GroupId

eu.maxschuster
ArtifactId

ArtifactId

dataurl
Last Version

Last Version

2.0.0
Release Date

Release Date

Type

Type

bundle
Description

Description

DataUrl
A library to create and parse RFC 2397 data urls.
Project URL

Project URL

https://github.com/maxschuster/DataUrl
Source Code Management

Source Code Management

https://github.com/maxschuster/DataUrl

Download dataurl

Dependencies

test (1)

Group / Artifact Type Version
junit : junit jar 4.12

Project Modules

There are no modules declared in this project.

DataUrl

A java library to create and parse RFC 2397 data urls.

Javadocs

Licence

Apache 2.0

Requirements

Requires java 8

Usage

Create/Serialize

IDataUrlSerializer serializer = new DataUrlSerializer();
byte[] redDotData = new byte[]{ /* DATA */ };
DataUrl unserialized = new DataUrlBuilder()
    .setMimeType("image/png")
    .setEncoding(DataUrlEncoding.BASE64)
    .setData(redDotData)
    .build();
String serialized = serializer.serialize(unserialized);
System.out.println(serialized);

Parse/Unserialize

IDataUrlSerializer serializer = new DataUrlSerializer();
String serialized = "data:image/png;base64,...";
DataUrl unserialized = serializer.unserialize(serialized);
byte[] redDotData = unserialized.getData();

Maven

<dependency>
    <groupId>eu.maxschuster</groupId>
    <artifactId>dataurl</artifactId>
    <version>2.0.0</version>
</dependency>

Versions

Version
2.0.0
1.1.0
1.0.0