Issue trying to read attachment in Groovy scripting
Summary:
We are trying to read the contents of an activity attachment and upload to an external web service in Groovy scripting.
We are having issues with taking the FileContents BlobDomain and converting to a Byte Array so that we can encode to base64 string.
Code Snippet (add any code snippets that support your topic, if applicable):
def atts = [];
def att = Attachments;
att.reset();
while (att.hasNext()) {
def curAtt = att.next();
def outStream = curAtt.FileContents.getBinaryOutputStream();
///// Error occurs on following line - Cannot find matching method java.io.OutputStream#toByteArray(). Please check if the declared type is correct and if the method exists. /////