public class BinaryData extends Object implements Cloneable, Serializable
Attribute extended CPAObjects (i.e. currently only the Channel object) support CPA Cache specific data types, besides
the following basic Java types: String, int, long and boolean. The data fields of the adapter type specific Channel
object can be defined through the adapter type meta data (schema). Currently supported additional data types are the
BinaryData
and TableData
object. Such data fields can be read from a Channel object by
the attribute name (defined in the schema), using the methods getValueAsBinary
or
getValueAsTable
. The adapters using the CPA Cache service API should never need to create the
described data container objects and should always retrieve them from a given Channel object, instead.
The BinaryData
object is a container for binary data, which can be read from the Channel object, as
configured in the Integration Directory or PCK configuration UI. Base64 encoding is supported.
TableData
,
Serialized FormConstructor and Description |
---|
BinaryData(byte[] binary)
The default constructor for the
BinaryData object. |
BinaryData(byte[] encodedBinary,
boolean base64Encoded)
The constructor for the
BinaryData object with Base64 encoded binary data. |
Modifier and Type | Method and Description |
---|---|
Object |
clone()
This method clones the contained byte array, in case that it is not null.
|
byte[] |
getData()
Returns the binary data as it is (either raw or Base64 encoded).
|
byte[] |
getDataBase64()
Returns the binary data in Base64 encoded form.
|
byte[] |
getDataRaw()
Returns the binary data in raw form.
|
boolean |
isBase64Encoded()
Returns if the binary data is Base64 encoded, or not.
|
void |
setData(byte[] binary)
Sets the binary data (not Base64 encoded).
|
void |
setData(byte[] binary,
boolean base64Encoded)
Sets the binary data (either raw or Base64 encoded).
|
int |
size() |
String |
toBase64EncodedString()
Returns the binary data as String (in Base64 encoded form).
|
String |
toRawString()
Returns the binary data as String (in raw form).
|
String |
toString()
Returns the binary data as String (either raw or Base64 encoded).
|
public BinaryData(byte[] binary)
BinaryData
object.binary
- The binary data as byte array.public BinaryData(byte[] encodedBinary, boolean base64Encoded)
BinaryData
object with Base64 encoded binary data.encodedBinary
- The binary data as byte array. Needs to be Base64 encoded, if the base64Encoded param is set
to true.base64Encoded
- Specifies if the encodedBinary byte array contains binary data is Base64 encoded form, or not.public int size()
public void setData(byte[] binary)
binary
- The binary data as byte array.public void setData(byte[] binary, boolean base64Encoded)
binary
- The binary data as byte array, either raw or Base64 encoded, depending on the base64Encoded paramter.base64Encoded
- Specifies, if the data given in the binary byte array is Base64 encoded, or not.public byte[] getData()
isBase64Encoded
method.public byte[] getDataRaw()
public byte[] getDataBase64()
public boolean isBase64Encoded()
public String toString()
isBase64Encoded
method.public String toRawString()
public String toBase64EncodedString()
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
Access Rights |
---|
SC | DC | Public Part | ACH |
---|---|---|---|
[sap.com] SAP_XIAF
|
[sap.com] com.sap.aii.af.svc.facade
|
api
|
BC-XI
|
Copyright 2019 SAP AG Complete Copyright Notice