Created
December 15, 2015 08:12
-
-
Save SriniBlog/ab39583b07e0955ba623 to your computer and use it in GitHub Desktop.
Read and Write the Payload using SAP PI Java Mapping
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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