Modifier | Constructor and Description |
---|---|
protected |
DataUrlDecoder(byte[] data,
String mediaType,
Charset charset)
C'tor.
|
Modifier and Type | Method and Description |
---|---|
static DataUrlDecoder |
decode(URL url)
Decodes a data URL providing simple access to the information contained by the URL.
|
static DataUrlDecoder |
decodeDataURL(String url)
Decodes a data URL providing simple access to the information contained by the URL.
|
byte[] |
getBytes()
Gets the bytes contained in the data URL.
|
String |
getCharset()
Gets the charset information specified in the data URL.
|
String |
getDataAsString()
Gets the text content of the data URL.
|
String |
getMediaType()
Gets the media type information contained in the data URL.
|
public static DataUrlDecoder decode(URL url) throws UnsupportedEncodingException
url
- the URL to decodeDataUrlDecoder
holding decoded informationUnsupportedEncodingException
- if the encoding specified by the data URL is invalid or notpublic static DataUrlDecoder decodeDataURL(String url) throws UnsupportedEncodingException
url
- the string representation of the URL to decodeDataUrlDecoder
holding decoded informationUnsupportedEncodingException
- if the encoding specified by the data URL is invalid or not
available on the JVMpublic String getMediaType()
public String getCharset()
public byte[] getBytes()
public String getDataAsString() throws UnsupportedEncodingException
UnsupportedEncodingException
- if decoding failed using the specified charsetCopyright © 2002–2024 Gargoyle Software Inc.. All rights reserved.