package at.gv.egovernment.moa.spss.server.iaik.xml;
import java.io.ByteArrayInputStream;
import java.io.InputStream;
import iaik.server.modules.xml.BinaryDataObject;
/**
* A BinaryDataObject
encapsulating Base64 data.
*
* @author Patrick Peck
* @version $Id$
*/
public class ByteArrayDataObjectImpl
extends DataObjectImpl
implements BinaryDataObject {
/** The binary data contained in this BinaryDataObject
. */
private byte[] bytes;
/**
* Create a new ByteArrayDataObjectImpl
.
*
* @param bytes The binary data contained in this
* BinaryDataObject
.
*/
public ByteArrayDataObjectImpl(byte[] bytes) {
setBytes(bytes);
}
/**
* Set the Base64 data.
*
* @param bytes The binary data contained in this
* BinaryDataObject
.
*/
public void setBytes(byte[] bytes) {
this.bytes = bytes;
}
/**
* Return the binary data encoded in the Base64 String
as a
* stream.
*
* @return The binary data contained in this object, as a
* InputStream
. Repeated calls to this function will return a
* new stream to the Base64 data.
* @see iaik.server.modules.xml.BinaryDataObject#getInputStream()
*/
public InputStream getInputStream() {
return new ByteArrayInputStream(bytes);
}
}