Used in conjunction with XMLStreamReaderEx
and XMLStreamWriterEx.
| Modifier and Type | Class and Description |
|---|---|
| private class | |
| private class | |
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| private static final int | |
| private byte[] | |
| private boolean | dataCloneByRef
True if |
| private DataHandler | |
| private int | |
| private String | |
| private static final Logger | |
| private String |
| Access | Constructor and Description |
|---|---|
| public | |
| public |
| Modifier and Type | Method and Description |
|---|---|
| public char | charAt(int index)
Implements java. Encode this binary data in the base64 encoding and returns the character at the specified position. |
| public Base64Data | |
| public byte[] | |
| public DataHandler | |
| public int | |
| public byte[] | |
| public String | |
| public InputStream | |
| public String | |
| pack-priv static String | |
| public boolean | Returns: false if it has only DataHandlerReturns false if this object only has |
| public int | length()
Implements java. Gets the number of characters needed to represent this binary data in the base64 encoding. |
| public void | |
| public void | |
| public void | |
| public void | |
| public void | |
| public CharSequence | subSequence(int start, int end)
Implements java. Internally this is only used to split a text to a list, which doesn't happen that much for base64. |
| public String | toString()
Overrides java. Implements java. Returns the base64 encoded string of this data. |
| public void | |
| public void |
| CHUNK_SIZE | back to summary |
|---|---|
| private static final int CHUNK_SIZE | |
| data | back to summary |
|---|---|
| private byte[] data | |
| dataCloneByRef | back to summary |
|---|---|
| private boolean dataCloneByRef True if | |
| dataHandler | back to summary |
|---|---|
| private DataHandler dataHandler | |
| dataLen | back to summary |
|---|---|
| private int dataLen Length of the valid data in | |
| hrefCid | back to summary |
|---|---|
| private String hrefCid | |
| logger | back to summary |
|---|---|
| private static final Logger logger | |
| mimeType | back to summary |
|---|---|
| private String mimeType Optional MIME type of | |
| Base64Data | back to summary |
|---|---|
| public Base64Data() Default constructor | |
| Base64Data | back to summary |
|---|---|
| public Base64Data(Base64Data that) Clone constructor
| |
| charAt | back to summary |
|---|---|
| public char charAt(int index) Implements java. Encode this binary data in the base64 encoding and returns the character at the specified position.
| |
| clone | back to summary |
|---|---|
| public Base64Data clone() Overrides java. Doc from java. Creates and returns a copy of this object. The precise meaning
of "copy" may depend on the class of the object. The general
intent is that, for any object will be true, and that the expression:x.clone() != x will bex.clone().getClass() == x.getClass() true, but these are not absolute requirements.
While it is typically the case that:
will bex.clone().equals(x) true, this is not an absolute requirement.
By convention, the returned object should be obtained by calling
By convention, the object returned by this method should be independent
of this object (which is being cloned). To achieve this independence,
it may be necessary to modify one or more fields of the object returned
by
| |
| get | back to summary |
|---|---|
| public byte[] get() Gets the raw data. The size of the byte array maybe larger than the actual length.
| |
| getDataHandler | back to summary |
|---|---|
| public DataHandler getDataHandler() Gets the raw data. If the returned DataHandler is
| |
| getDataLen | back to summary |
|---|---|
| public int getDataLen() Gets the length of the binary data counted in bytes.
Note that if this object encapsulates
| |
| getExact | back to summary |
|---|---|
| public byte[] getExact() Gets the byte[] of the exact length.
| |
| getHrefCid | back to summary |
|---|---|
| public String getHrefCid() | |
| getInputStream | back to summary |
|---|---|
| public InputStream getInputStream() throws IOException Gets the data as an
| |
| getMimeType | back to summary |
|---|---|
| public String getMimeType() | |
| getProperty | back to summary |
|---|---|
| pack-priv static String getProperty(final String propName) | |
| hasData | back to summary |
|---|---|
| public boolean hasData() Returns false if this object only has
| |
| length | back to summary |
|---|---|
| public int length() Implements java. Gets the number of characters needed to represent this binary data in the base64 encoding.
| |
| set | back to summary |
|---|---|
| public void set(byte[] data, int len, String mimeType, boolean cloneByRef) Fills in the data object by a portion of the byte[].
| |
| set | back to summary |
|---|---|
| public void set(byte[] data, int len, String mimeType) Fills in the data object by a portion of the byte[].
| |
| set | back to summary |
|---|---|
| public void set(byte[] data, String mimeType) Fills in the data object by the byte[] of the exact length.
| |
| set | back to summary |
|---|---|
| public void set(DataHandler data) Fills in the data object by a
| |
| setHrefCid | back to summary |
|---|---|
| public void setHrefCid(final String cid) | |
| subSequence | back to summary |
|---|---|
| public CharSequence subSequence(int start, int end) Implements java. Internally this is only used to split a text to a list, which doesn't happen that much for base64. So this method should be smaller than faster.
| |
| toString | back to summary |
|---|---|
| public String toString() Overrides java. Implements java. Returns the base64 encoded string of this data.
| |
| writeTo | back to summary |
|---|---|
| public void writeTo(char[] buf, int start) | |
| writeTo | back to summary |
|---|---|
| public void writeTo(XMLStreamWriter output) throws IOException, XMLStreamException | |
| Access | Constructor and Description |
|---|---|
| private |
| Modifier and Type | Method and Description |
|---|---|
| public String | getContentType()
Implements jakarta. This method returns the MIME type of the data in the form of a string. |
| public InputStream | getInputStream()
Implements jakarta. This method returns an |
| public String | getName()
Implements jakarta. Return the name of this object where the name of the object is dependant on the nature of the underlying objects. |
| public OutputStream | getOutputStream()
Implements jakarta. This method returns an |
| Base64DataSource | back to summary |
|---|---|
| private Base64DataSource() | |
| getContentType | back to summary |
|---|---|
| public String getContentType() Implements jakarta. Doc from jakarta. This method returns the MIME type of the data in the form of a string. It should always return a valid type. It is suggested that getContentType return "application/octet-stream" if the DataSource implementation can not determine the data type. | |
| getInputStream | back to summary |
|---|---|
| public InputStream getInputStream() Implements jakarta. Doc from jakarta. This method returns an | |
| getName | back to summary |
|---|---|
| public String getName() Implements jakarta. Doc from jakarta. Return the name of this object where the name of the object is dependant on the nature of the underlying objects. DataSources encapsulating files may choose to return the filename of the object. (Typically this would be the last component of the filename, not an entire pathname.) | |
| getOutputStream | back to summary |
|---|---|
| public OutputStream getOutputStream() Implements jakarta. Doc from jakarta. This method returns an | |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements abstract org. Implements java. Releases any resources associated with this DataHandler. |
| public void | moveTo(File dst)
Implements abstract org. Obtains the BLOB into a specified file. |
| public InputStream | readOnce()
Implements abstract org. Works like |
| Base64StreamingDataHandler | back to summary |
|---|---|
| pack-priv Base64StreamingDataHandler(DataSource source) | |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements abstract org. Implements java. Doc from org. Releases any resources associated with this DataHandler. (such as an attachment in a web service read from a temp file will be deleted.) After calling this method, it is illegal to call any other methods.
| |
| moveTo | back to summary |
|---|---|
| public void moveTo(File dst) throws IOException Implements abstract org. Doc from org. Obtains the BLOB into a specified file. Semantically, this method is roughly equivalent to the following code, except that the actual implementation is likely to be a lot faster. InputStream i = getInputStream(); OutputStream o = new FileOutputStream(dst); int ch; while((ch=i.read())!=-1) o.write(ch); i.close(); o.close();
The main motivation behind this method is that often
This method shouldn't be called when there are any open streams.
After this method is invoked,
| |
| readOnce | back to summary |
|---|---|
| public InputStream readOnce() throws IOException Implements abstract org. Doc from org. Works like
This is used as a signal from the caller that there will
be no further
When
Note that it is legal to call
| |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void | close()
Implements abstract org. Implements java. Releases any resources associated with this DataHandler. |
| public void | moveTo(File dst)
Implements abstract org. Obtains the BLOB into a specified file. |
| public InputStream | readOnce()
Implements abstract org. Works like |
| FilterDataHandler | back to summary |
|---|---|
| pack-priv FilterDataHandler(DataHandler dh) | |
| close | back to summary |
|---|---|
| public void close() throws IOException Implements abstract org. Implements java. Doc from org. Releases any resources associated with this DataHandler. (such as an attachment in a web service read from a temp file will be deleted.) After calling this method, it is illegal to call any other methods.
| |
| moveTo | back to summary |
|---|---|
| public void moveTo(File dst) throws IOException Implements abstract org. Doc from org. Obtains the BLOB into a specified file. Semantically, this method is roughly equivalent to the following code, except that the actual implementation is likely to be a lot faster. InputStream i = getInputStream(); OutputStream o = new FileOutputStream(dst); int ch; while((ch=i.read())!=-1) o.write(ch); i.close(); o.close();
The main motivation behind this method is that often
This method shouldn't be called when there are any open streams.
After this method is invoked,
| |
| readOnce | back to summary |
|---|---|
| public InputStream readOnce() throws IOException Implements abstract org. Doc from org. Works like
This is used as a signal from the caller that there will
be no further
When
Note that it is legal to call
| |