Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save viksingh/ce5341ca5a9a99e62a441f0b44883045 to your computer and use it in GitHub Desktop.
Save viksingh/ce5341ca5a9a99e62a441f0b44883045 to your computer and use it in GitHub Desktop.
Read and Write the Payload using SAP PI Java Mapping
public void transform(TransformationInput arg0, TransformationOutput arg1) throws StreamTransformationException {
try {
InputStream in = arg0.getInputPayload().getInputStream();
OutputStream out = arg1.getOutputPayload().getOutputStream();
int buffer;
//Read and Write back the file
while ((buffer = in.read()) != -1)
{
out.write(buffer);
}
out.flush();
}catch (Exception e) {
throw new StreamTransformationException(e.getMessage());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment