|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jvnet.staxex.Base64Data
public class Base64Data
Binary data represented as base64-encoded string in XML.
Used in conjunction with XMLStreamReaderEx
and XMLStreamWriterEx.
| Constructor Summary | |
|---|---|
Base64Data()
Default constructor |
|
Base64Data(Base64Data that)
Clone constructor |
|
| Method Summary | |
|---|---|
char |
charAt(int index)
Encode this binary data in the base64 encoding and returns the character at the specified position. |
Base64Data |
clone()
|
byte[] |
get()
Gets the raw data. |
DataHandler |
getDataHandler()
Gets the raw data. |
int |
getDataLen()
Gets the length of the binary data counted in bytes. |
byte[] |
getExact()
Gets the byte[] of the exact length. |
String |
getHrefCid()
|
InputStream |
getInputStream()
Gets the data as an InputStream. |
String |
getMimeType()
|
boolean |
hasData()
Returns false if this object only has DataHandler and therefore
get() operation is likely going to be expensive. |
int |
length()
Gets the number of characters needed to represent this binary data in the base64 encoding. |
void |
set(byte[] data,
int len,
String mimeType)
Fills in the data object by a portion of the byte[]. |
void |
set(byte[] data,
int len,
String mimeType,
boolean cloneByRef)
Fills in the data object by a portion of the byte[]. |
void |
set(byte[] data,
String mimeType)
Fills in the data object by the byte[] of the exact length. |
void |
set(DataHandler data)
Fills in the data object by a DataHandler. |
void |
setHrefCid(String cid)
|
CharSequence |
subSequence(int start,
int end)
Internally this is only used to split a text to a list, which doesn't happen that much for base64. |
String |
toString()
Returns the base64 encoded string of this data. |
void |
writeTo(char[] buf,
int start)
|
void |
writeTo(XMLStreamWriter output)
|
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public Base64Data()
public Base64Data(Base64Data that)
that - needs to be cloned| Method Detail |
|---|
public void set(byte[] data,
int len,
String mimeType,
boolean cloneByRef)
data - actual datalen - data[0] to data[len-1] are treated as the data.mimeType - MIME typecloneByRef - true if data[] can be cloned by reference
public void set(byte[] data,
int len,
String mimeType)
data - actual data byteslen - data[0] to data[len-1] are treated as the data.mimeType - MIME type
public void set(byte[] data,
String mimeType)
data - this buffer may be owned directly by the unmarshaleld JAXB object.mimeType - MIME typepublic void set(DataHandler data)
DataHandler.
data - DataHandler for the datapublic DataHandler getDataHandler()
StreamingDataHandler,
callees may need to downcast to take advantage of its capabilities.
StreamingDataHandlerpublic byte[] getExact()
public InputStream getInputStream()
throws IOException
InputStream.
IOException - if i/o error occurspublic boolean hasData()
DataHandler and therefore
get() operation is likely going to be expensive.
public byte[] get()
public int getDataLen()
DataHandler,
this method would have to read the whole thing into byte[]
just to count the length, because DataHandler
doesn't easily expose the length.
public String getMimeType()
public int length()
length in interface CharSequencepublic char charAt(int index)
charAt in interface CharSequence
public CharSequence subSequence(int start,
int end)
subSequence in interface CharSequencepublic String toString()
toString in interface CharSequencetoString in class Object
public void writeTo(char[] buf,
int start)
public void writeTo(XMLStreamWriter output)
throws IOException,
XMLStreamException
IOException
XMLStreamExceptionpublic Base64Data clone()
clone in class Objectpublic String getHrefCid()
public void setHrefCid(String cid)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||