|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.sun.xml.bind.v2.runtime.output.Pcdata
com.sun.xml.bind.v2.runtime.unmarshaller.Base64Data
public final class Base64Data
Fed to unmarshaller when the 'text' data is actually a virtual image of base64 encoding of the binary data transferred on the wire. Used for the MTOM support. This object is mutable and the owner of this object can reuse it with new data. Also used by the marshaller to write out the binary data that could be possibly attached.
XmlVisitor.text(CharSequence)
,
XMLSerializer.text(Pcdata,String)
Constructor Summary | |
---|---|
Base64Data()
|
Method Summary | |
---|---|
char |
charAt(int index)
Encode this binary data in the base64 encoding and returns the character at the specified position. |
byte[] |
get()
Gets the raw data. |
javax.activation.DataHandler |
getDataHandler()
Gets the raw data. |
int |
getDataLen()
|
byte[] |
getExact()
Gets the byte[] of the exact length. |
java.io.InputStream |
getInputStream()
Gets the data as an InputStream . |
java.lang.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,
java.lang.String mimeType)
Fills in the data object by a portion of the byte[]. |
void |
set(byte[] data,
java.lang.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 . |
java.lang.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. |
java.lang.String |
toString()
Returns the base64 encoded string of this data. |
void |
writeTo(char[] buf,
int start)
Writes itself to the character array. |
void |
writeTo(UTF8XmlOutput output)
Writes itself to UTF8XmlOutput . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Base64Data()
Method Detail |
---|
public void set(byte[] data, int len, @Nullable java.lang.String mimeType)
len
- data[0] to data[len-1] are treated as the data.public void set(byte[] data, @Nullable java.lang.String mimeType)
data
- this buffer may be owned directly by the unmarshaleld JAXB object.public void set(javax.activation.DataHandler data)
DataHandler
.
public javax.activation.DataHandler getDataHandler()
public byte[] getExact()
public java.io.InputStream getInputStream() throws java.io.IOException
InputStream
.
java.io.IOException
public boolean hasData()
DataHandler
and therefore
get()
operation is likely going to be expensive.
public byte[] get()
public int getDataLen()
public java.lang.String getMimeType()
public int length()
public char charAt(int index)
public java.lang.CharSequence subSequence(int start, int end)
public java.lang.String toString()
toString
in interface java.lang.CharSequence
toString
in class Pcdata
public void writeTo(char[] buf, int start)
Pcdata
This method is used by most other XmlOutput
.
The default implementation involves in one extra char[] copying.
The caller must provide a big enough buffer that can hold
enough characters returned by the CharSequence.length()
method.
writeTo
in class Pcdata
public void writeTo(UTF8XmlOutput output) throws java.io.IOException
Pcdata
UTF8XmlOutput
.
This is the most performance critical path for the marshaller, so it warrants its own method.
writeTo
in class Pcdata
java.io.IOException
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |