public final class DataUri extends Object
Represents a URI for encoding binary data.
Example: data:image/jpeg;base64,[base64 string]
Constructor and Description |
---|
DataUri(String uri)
Parses a data URI string.
|
DataUri(String contentType,
byte[] data)
Creates a data URI.
|
public DataUri(String contentType, byte[] data)
contentType
- the content type (e.g. "image/jpeg")data
- the binary datapublic DataUri(String uri)
uri
- the data URI to parse (e.g.
"data:image/jpeg;base64,[base64 string]")IllegalArgumentException
- if the given URI is not a valid data URIpublic byte[] getData()
public String getContentType()
This software is published under the BSD license. Copyright © 2003-${build.year}, CRIXP AG, Switzerland, All rights reserved. Use is subject to license terms.