|
|||||||||
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. |
javax.activation.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. |
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(javax.activation.DataHandler data)
Fills in the data object by a DataHandler . |
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)
|
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 clonedMethod 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 referencepublic 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 typepublic void set(byte[] data, String mimeType)
data
- this buffer may be owned directly by the unmarshaleld JAXB object.mimeType
- MIME typepublic void set(javax.activation.DataHandler data)
DataHandler
.
data
- DataHandler for the datapublic javax.activation.DataHandler getDataHandler()
StreamingDataHandler
,
callees may need to downcast to take advantage of its capabilities.
StreamingDataHandler
public 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 CharSequence
public char charAt(int index)
charAt
in interface CharSequence
public CharSequence subSequence(int start, int end)
subSequence
in interface CharSequence
public String toString()
toString
in interface CharSequence
toString
in class Object
public void writeTo(char[] buf, int start)
public Base64Data clone()
clone
in class Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |