com.waveset.util
Class Binary

java.lang.Object
  extended bycom.waveset.util.AbstractXmlObject
      extended bycom.waveset.util.Binary
All Implemented Interfaces:
javax.naming.Referenceable, XmlObject

public class Binary
extends AbstractXmlObject

The Binary class represents an arbitrary chunk of binary data. The data is stored internally as a base-64 encoded string. It corresponds to an attribute value of "binary" Syntax.


Field Summary
static java.lang.String code_id
           
 
Fields inherited from class com.waveset.util.AbstractXmlObject
_trace
 
Constructor Summary
Binary(byte[] data)
          Construct a Binary with the data byte[] array.
Binary(javax.activation.DataSource dataSource)
          Contruct a Binary object from a DataSource.
Binary(org.w3c.dom.Element e)
          XML constructor required by the XmlObject interface.
Binary(java.io.InputStream in)
          Contruct a Binary with an InputStream of bytes.
Binary(java.io.InputStream in, boolean close)
          Contruct a Binary with an InputStream of bytes.
Binary(java.lang.String data)
          Construct a Binary with a base64 encoded string.
 
Method Summary
 boolean equals(java.lang.Object other)
           
 java.lang.String getElementName()
          Return the desired XML element name, required by the XmlObject interface.
 boolean isNull()
           
 byte[] toDecodedByteArray()
           
 java.lang.String toEncodedString()
           
 java.lang.String toString()
          Returns a brief description of the object
 void toXml(java.lang.StringBuffer b, int indent)
          Generate the XML rendering of the data, required by the XmlObject interface.
 
Methods inherited from class com.waveset.util.AbstractXmlObject
addXmlHeader, cloneObject, dump, dumpFile, getReference, println, setTrace, toIdentityString, toVerboseString, toVerboseString, toXml, toXml, toXml
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

code_id

public static final java.lang.String code_id
See Also:
Constant Field Values
Constructor Detail

Binary

public Binary(byte[] data)
Construct a Binary with the data byte[] array.


Binary

public Binary(java.lang.String data)
       throws WavesetException
Construct a Binary with a base64 encoded string.

Parameters:
data -
Throws:
WavesetException

Binary

public Binary(java.io.InputStream in)
       throws IOException
Contruct a Binary with an InputStream of bytes. Closes the InputStream by default.

Parameters:
in -

Binary

public Binary(java.io.InputStream in,
              boolean close)
       throws IOException
Contruct a Binary with an InputStream of bytes.

Parameters:
in - Source of bytes to encode..
close - Close the InputStream or not..

Binary

public Binary(org.w3c.dom.Element e)
       throws WavesetException
XML constructor required by the XmlObject interface.


Binary

public Binary(javax.activation.DataSource dataSource)
       throws IOException
Contruct a Binary object from a DataSource.

Parameters:
dataSource -
Throws:
IOException
Method Detail

isNull

public boolean isNull()
Returns:
returns true if null or no data present

toDecodedByteArray

public byte[] toDecodedByteArray()
Returns:
returns the decoded byte[] value

toEncodedString

public java.lang.String toEncodedString()
Returns:
returns the encoded String value

toString

public java.lang.String toString()
Returns a brief description of the object


equals

public boolean equals(java.lang.Object other)

getElementName

public java.lang.String getElementName()
Return the desired XML element name, required by the XmlObject interface.

Specified by:
getElementName in interface XmlObject
Specified by:
getElementName in class AbstractXmlObject

toXml

public void toXml(java.lang.StringBuffer b,
                  int indent)
Generate the XML rendering of the data, required by the XmlObject interface.

Specified by:
toXml in interface XmlObject
Specified by:
toXml in class AbstractXmlObject